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

run-emitter-test-suite: negative-size-param in get_tag/memcpy #270

Open
251 opened this issue Jun 22, 2023 · 0 comments
Open

run-emitter-test-suite: negative-size-param in get_tag/memcpy #270

251 opened this issue Jun 22, 2023 · 0 comments

Comments

@251
Copy link

251 commented Jun 22, 2023

In get_tag:

if ((start = strchr(line, '<')) == NULL)

probably the ordering of start/end should be checked before memcpy:

$ printf '+SEQ><\n' > A
$ yaml-0.2.5/bin/run-emitter-test-suite "--directive" "1.1" "--flow" "keep" "A"
==1542==ERROR: AddressSanitizer: negative-size-param: (size=-2)

gdb backtrace:

#17 0x0000000000500952 in get_tag (line=0x7fffffffd590 "+SEQ><", tag=0x7fffffffdf00 "\300\220^") at yaml-0.2.5/tests/run-emitter-test-suite.c:228
#18 0x0000000000500522 in main (argc=6, argv=0x7fffffffe348) at yaml-0.2.5/tests/run-emitter-test-suite.c:125

(found by KLEE)

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

No branches or pull requests

1 participant