Repository navigation
Make C25 fix for build ids containing a zero byte - #5480
Merged
Merged
Conversation
hlwarriner
force-pushed
the
buildid-fix-25
branch
from
April 21, 2025 17:44
fb62599 to
9374e71
Compare
Member
Author
|
I looked into adding a unit test for
I'll think more about this - and suggestions are welcome - but I don't think we should block the fix on the unit test. I did do some manual end-to-end testing, for example in https://b.corp.google.com/issues/408471930#comment5. |
y4vor
approved these changes
Apr 21, 2025
yell0wd0g
approved these changes
Apr 21, 2025
hlwarriner
force-pushed
the
buildid-fix-25
branch
from
April 21, 2025 19:21
9374e71 to
e32a9bf
Compare
This change replaces strlcpy with memcpy for copying build ids. As described in the bug, a byte array representing a build id should not be treated as a string; it may contain zero bytes (0x00) and these should not be considered null terminators. Changing the type of build_id in the EvergreenInfo struct from char array to uint8_t would help avoid these types of bugs. But I would rather save that change for C26. b/408471930 Change-Id: I02cddaf01c47b0883d21997c36ea0c9d1c8ca40c
Change-Id: Ib6cf07f9cda66a055514b4bce53424e25adaa0c6
hlwarriner
force-pushed
the
buildid-fix-25
branch
from
April 21, 2025 19:38
e32a9bf to
04269df
Compare
Member
Author
|
I believe the failing checks are all from b/255654807 and unrelated to this change. |
hlwarriner
added a commit
to hlwarriner/cobalt
that referenced
this pull request
Apr 22, 2025
This change is based on youtube#5480, which makes this fix on the 25.lts.1+ branch. This current change goes a step further by changing the type of build_id in the EvergreenInfo struct; a uint8_t array should better represent the data and provide some type safety. b/408471930
hlwarriner
added a commit
to hlwarriner/cobalt
that referenced
this pull request
Apr 23, 2025
This change is based on youtube#5480, which makes this fix on the 25.lts.1+ branch. This current change goes a step further by changing the type of build_id in the EvergreenInfo struct; a uint8_t array should better represent the data and provide some type safety. b/408471930
hlwarriner
added a commit
that referenced
this pull request
Apr 23, 2025
This change is based on #5480, which makes this fix on the 25.lts.1+ branch. This current change goes a step further by changing the type of build_id in the EvergreenInfo struct; a uint8_t array should better represent the data and provide some type safety. b/408471930
kaidokert
pushed a commit
to kaidokert/cobalt
that referenced
this pull request
Jun 15, 2025
This change is based on youtube#5480, which makes this fix on the 25.lts.1+ branch. This current change goes a step further by changing the type of build_id in the EvergreenInfo struct; a uint8_t array should better represent the data and provide some type safety. b/408471930
sideb0ard
pushed a commit
to sideb0ard/cobalt
that referenced
this pull request
Jul 25, 2025
Original Message: Fwd port fix for build ids containing a zero byte (youtube#5502) This change is based on youtube#5480, which makes this fix on the 25.lts.1+ branch. This current change goes a step further by changing the type of build_id in the EvergreenInfo struct; a uint8_t array should better represent the data and provide some type safety. b/408471930 original-hexsha: cb7ef3a Files with conflicts: - starboard/elf_loader/evergreen_info.h
sideb0ard
pushed a commit
to sideb0ard/cobalt
that referenced
this pull request
Jul 26, 2025
This change is based on youtube#5480, which makes this fix on the 25.lts.1+ branch. This current change goes a step further by changing the type of build_id in the EvergreenInfo struct; a uint8_t array should better represent the data and provide some type safety. b/408471930 original-hexsha: cb7ef3a
sideb0ard
pushed a commit
to sideb0ard/cobalt
that referenced
this pull request
Jul 30, 2025
This change is based on youtube#5480, which makes this fix on the 25.lts.1+ branch. This current change goes a step further by changing the type of build_id in the EvergreenInfo struct; a uint8_t array should better represent the data and provide some type safety. b/408471930 original-hexsha: cb7ef3a
madhurajayaraman
pushed a commit
to madhurajayaraman/cobalt
that referenced
this pull request
Sep 9, 2025
This change is based on youtube#5480, which makes this fix on the 25.lts.1+ branch. This current change goes a step further by changing the type of build_id in the EvergreenInfo struct; a uint8_t array should better represent the data and provide some type safety. b/408471930 original-hexsha: cb7ef3a
sideb0ard
pushed a commit
to sideb0ard/cobalt
that referenced
this pull request
Sep 10, 2025
This change is based on youtube#5480, which makes this fix on the 25.lts.1+ branch. This current change goes a step further by changing the type of build_id in the EvergreenInfo struct; a uint8_t array should better represent the data and provide some type safety. b/408471930 original-hexsha: cb7ef3a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change replaces strlcpy with memcpy for copying build ids. As described in the bug, a byte array representing a build id should not be treated as a string; it may contain zero bytes (0x00) and these should not be considered null terminators.
Changing the type of build_id in the EvergreenInfo struct from char array to uint8_t would help avoid these types of bugs. But I would rather save that change for C26.
b/408471930
Change-Id: I02cddaf01c47b0883d21997c36ea0c9d1c8ca40c