-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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] Encoding embedded 0s in UTF8 strings #30342
Comments
Spec of Matter-TLV:
Having 1 terminating null (let alone 10) is forbidden. Our TLVWriter must error-out on this. |
This part is initializing the timezone name to "64 0 bytes". Why @fessehaeve @cecille ? Shouldn't it default to "no name" (i.e. NullOptional), just like it would if timezone gets set to something with no name via command? |
Not only that. This is also wrong:
And because we serialized char-spans with embedded 0s (64 of them), they will be wrong on load as well and that has to be fixed too (so it auto-corrects old wrong data). This code needs significant review and not sure how easy that even is. |
If this is not urgent, I can commit to fixing this (in timesync*) post the Nov 20 deadline for v1.3. |
Reproduction steps
Ran a commissioning locally to capture trace results. Something like
./out/linux-x64-chip-tool/chip-tool pairing onnetwork 1 20202021 --trace-to json:$HOME/tmp/pairing.json
Looking at the content, the read of timezones decodes in TLV as:
That UTF8 string (looks like tag2 ==
optional char_string<64> name = 2
) looks very much invalid. SHould have been empty string (smaller payload and generally correct UTF8)GitHub hash of the SDK that was being used
1813bfa
Platform
linux
The text was updated successfully, but these errors were encountered: