Skip to content
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

Error parsing date time with leading zero and space delimiter #130

Closed
moorereason opened this issue Jan 5, 2022 · 1 comment
Closed
Assignees
Labels
bug Something isn't working implemented in v3 Fixes + features which were implemented in v3 release. TOML spec An issue relating to the library's TOML spec conformance.

Comments

@moorereason
Copy link

Environment

toml++ version and/or commit hash:
v3 b41e12f

Compiler:
gcc 11.1.0

C++ standard mode:
c++20

Target arch:
linux x86_64

Library configuration overrides:
n/a

Relevant compilation flags:
meson build_tt --buildtype=release -Dbuild_tt_encoder=true -Dbuild_tt_decoder=true -Dgenerate_cmake_config=false

Describe the bug

The following TOML date time should be valid but fails:

0400-01-01 00:00:00

However, the following values work correctly:

0400-01-01           # no time component
0400-01-01T00:00:00  # T separator
1000-01-01 00:00:00  # no leading zero

Steps to reproduce (or a small repro code sample)

On Linux:

$ echo "0=0400-01-01 00:00:00" | tt_decoder

Error while parsing key-value pair: expected a comment or whitespace, saw '0'
 (error occurred at line 1, column 14 of 'stdin')

Additional information

Found while doing differential fuzzing against go-toml.

@moorereason moorereason added the bug Something isn't working label Jan 5, 2022
@marzer marzer added v3 TOML spec An issue relating to the library's TOML spec conformance. labels Jan 5, 2022
marzer added a commit that referenced this issue Jan 5, 2022
also:
- fixed omitting value part from hex/bin/oct being accepted without error (closes #129)
- added spec bug github template
@marzer
Copy link
Owner

marzer commented Jan 5, 2022

Fixed in v3, thanks.

@marzer marzer closed this as completed Jan 5, 2022
@marzer marzer added implemented in v3 Fixes + features which were implemented in v3 release. v3 and removed v3 labels Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working implemented in v3 Fixes + features which were implemented in v3 release. TOML spec An issue relating to the library's TOML spec conformance.
Projects
None yet
Development

No branches or pull requests

2 participants