Fixes cctz::parse() to reject input with embedded NULs#337
Merged
derekmauro merged 1 commit intogoogle:masterfrom Feb 12, 2026
Merged
Fixes cctz::parse() to reject input with embedded NULs#337derekmauro merged 1 commit intogoogle:masterfrom
derekmauro merged 1 commit intogoogle:masterfrom
Conversation
dinord
reviewed
Feb 12, 2026
dinord
approved these changes
Feb 12, 2026
copybara-service bot
pushed a commit
to abseil/abseil-cpp
that referenced
this pull request
Feb 12, 2026
This change adds the test case from google/cctz#337 PiperOrigin-RevId: 869318402 Change-Id: Ic6136aa56bf41e85e0ad42b6410c7430729bcd13
devbww
added a commit
to devbww/cctz
that referenced
this pull request
Feb 19, 2026
The previous commit (PR google#337) was couched in terms of `parse()` rejecting input strings containing NULs. Instead, we should treat NULs like other characters by allowing them in both the format and input strings. Similarly, `format()` should allow NULs in its format string. Also: - Simplify `FormatTM()` calls by handling an empty format string internally, rather than by guarding each invocation. - Utilize the `std::string` iterator-pair constructor and `append()`.
Contributor
|
Thanks for taking care of this, @derekmauro. However, it seems to me that, rather than rejecting inputs containing NULs, a better approach would be to treat NULs just like other characters---to be matched between the input and format strings as they occur. The parameters are To that end, I'll send a PR presently. Please take a look. |
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.
Original report: abseil/abseil-cpp#2014