Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] PR 22708 causing some regressions #23200

Closed
chrisdecenzo opened this issue Oct 14, 2022 · 2 comments · Fixed by #23231
Closed

[BUG] PR 22708 causing some regressions #23200

chrisdecenzo opened this issue Oct 14, 2022 · 2 comments · Fixed by #23231
Assignees

Comments

@chrisdecenzo
Copy link
Contributor

chrisdecenzo commented Oct 14, 2022

Reproduction steps

Bug in the following:
#22708

This PR replaced some uses of strncpy with CopyString which can be a problem when the length value passed does not include the null termination character since CopyString will always add a null terminator.

Specific bug:
examples/chip-tool/commands/clusters/ComplexArgument.h

This manifests itself in chip-tool whenever JSON strings are parsed. The result is that the final character of each string is getting truncated.

Example:
./out/debug/chip-tool applicationlauncher launch-app '{"catalogVendorId": 123, "applicationId": "exampleid"}' 1 1

You will see this command received on the DUT with applicationId field set to "examplei" rather than "exampleid"

It probably makes sense to review the PR for other places where the same problem can happen.

Bug prevalence

always

GitHub hash of the SDK that was being used

master

Platform

core

Platform Version(s)

No response

Anything else?

No response

@chrisdecenzo
Copy link
Contributor Author

Need someone to confirm that this part has been done:

It probably makes sense to review the PR for other places where the same problem can happen.

@chrisdecenzo chrisdecenzo reopened this Oct 18, 2022
@emargolis
Copy link
Contributor

I did a detailed review of all other similar changes in the above mentioned PR and I confirm that they all look correct to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants