datetime: fix strptime for fuzzer
Google fuzzing efforts revealed yet another bound condition we don't handle well in the `tnt_strptime` function: - for format `%m%g%W`; - and input string `07001`. We failed with assertion failure: ``` | datetime_strptime_fuzzer: ./src/lib/core/datetime.c:148: \ _Bool tm_to_datetime(struct tnt_tm *, struct datetime *): \ Assertion `mday >= 1 && mday <= 31' failed. ``` Closes #8525 NO_TEST=updated fuzzer corpus NO_CHANGELOG=internal NO_DOC=internal
Showing
- changelogs/unreleased/gh-8525-strptime-fix.md 3 additions, 0 deletionschangelogs/unreleased/gh-8525-strptime-fix.md
- src/lib/tzcode/strptime.c 2 additions, 3 deletionssrc/lib/tzcode/strptime.c
- test/static/corpus/datetime_strptime/clusterfuzz-6575551489114112 1 addition, 0 deletions...tic/corpus/datetime_strptime/clusterfuzz-6575551489114112
Please register or sign in to comment