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

Undefined behavior in byte_cursor_limit_tests #466

Closed
jkuszmaul opened this issue Jul 25, 2019 · 2 comments
Closed

Undefined behavior in byte_cursor_limit_tests #466

jkuszmaul opened this issue Jul 25, 2019 · 2 comments
Labels
bug This issue is a bug. needs-review This issue or pull request needs review from a core team member. p2 This is a standard priority issue

Comments

@jkuszmaul
Copy link

jkuszmaul commented Jul 25, 2019

At

ASSERT_TRUE(aws_byte_buf_write(&buffer, arr, 0));

in byte_cursor_limit_tests, aws_byte_buf_write is called after aws_byte_buf_clean_up(&buffer) (which I assume is intentional). This results in a call to memcpy with NULL pointer and a length of zero. This appears to be undefined behavior (see https://en.cppreference.com/w/c/string/byte/memcpy), and results in the test failing if I run it under clang's ubsan.

@jmklix jmklix added bug This issue is a bug. p2 This is a standard priority issue needs-review This issue or pull request needs review from a core team member. labels Aug 28, 2023
@TingDaoK
Copy link
Contributor

@jmklix
Copy link
Member

jmklix commented Dec 13, 2023

This was fixed in the above commit. Closing this issue

@jmklix jmklix closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-review This issue or pull request needs review from a core team member. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants