Skip to content

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