Commit d45588bd authored by Lucian Grijincu's avatar Lucian Grijincu Committed by Facebook Github Bot 4

folly: fbvector: ubsan: avoid memcpy(dest, nullptr, 0)

Reviewed By: meyering

Differential Revision: D3277138

fbshipit-source-id: 7050d18c256ac15c8122d4af59aa31208b1466fd
parent 5a081994
......@@ -636,7 +636,9 @@ private:
}
void relocate_move_or_memcpy(T* dest, T* first, T* last, std::true_type) {
std::memcpy((void*)dest, (void*)first, (last - first) * sizeof(T));
if (first != nullptr) {
std::memcpy((void*)dest, (void*)first, (last - first) * sizeof(T));
}
}
void relocate_move_or_memcpy(T* dest, T* first, T* last, std::false_type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment