Skip to content

Make cctz::ParseDateTime() return NULL on failure#347

Open
higher-performance wants to merge 1 commit into
google:masterfrom
higher-performance:malformed-date-time
Open

Make cctz::ParseDateTime() return NULL on failure#347
higher-performance wants to merge 1 commit into
google:masterfrom
higher-performance:malformed-date-time

Conversation

@higher-performance

Copy link
Copy Markdown
Collaborator

Prevents uninitialized data from being returned when the input is malformed (say, when the footer is \nPST8PDT,M3\n).

@mkruskal-google mkruskal-google self-assigned this Jul 10, 2026
Comment thread src/time_zone_posix.cc Outdated
@higher-performance higher-performance force-pushed the malformed-date-time branch 3 times, most recently from ae3f739 to 0944ced Compare July 11, 2026 03:03
Comment thread src/time_zone_posix.cc Outdated
@mkruskal-google mkruskal-google requested a review from devbww July 11, 2026 03:44
Comment thread src/time_zone_posix_test.cc Outdated

TEST(TimeZonePosix, ParsePosixSpec) {
PosixTimeZone zone;
EXPECT_FALSE(ParsePosixSpec("PST8PDT7", &zone));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for introducing the test.

I don't expect you do this, but, if you have the inclination, this now affords the opportunity to add a more extensive test suite.

Prevents uninitialized data from being returned when the input is malformed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants