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

Fix undefined in format-test #1349

Merged
merged 1 commit into from
Oct 8, 2019
Merged

Fix undefined in format-test #1349

merged 1 commit into from
Oct 8, 2019

Conversation

orivej
Copy link
Contributor

@orivej orivej commented Oct 8, 2019

When MoveCtor performs check_move_buffer, the buffer allocator becomes null, but then MoveCtor attempts to use it to allocate a dynamic buffer. This succeeds nevertheless because a typical std::allocator<char>::allocate does not use this, so it does not crash when this is null.

Fixes #1344

When `MoveCtor` performs `check_move_buffer`, the buffer allocator becomes null,
but then `MoveCtor` attempts to use it to allocate a dynamic buffer. This
succeeds nevertheless because a typical `std::allocator<char>::allocate` does
not use `this`, so it does not crash when `this` is null.

Fixes fmtlib#1344
@vitaut vitaut merged commit a1079e9 into fmtlib:master Oct 8, 2019
@vitaut
Copy link
Contributor

vitaut commented Oct 8, 2019

Thanks!

@orivej orivej deleted the ubsan-format branch October 11, 2019 23:55
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.

MemoryBufferTest.MoveCtor provokes undefined sanitizer
2 participants