]> git.ipfire.org Git - thirdparty/vectorscan.git/commit
Fix segfaults on allocation failure (#4)
authorhongyang7 <yang.a.hong@intel.com>
Thu, 16 Dec 2021 11:02:17 +0000 (19:02 +0800)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Mon, 29 Aug 2022 12:03:18 +0000 (15:03 +0300)
commit2731a3384bbd7ffc4933f6d43478ef2762e5b4d8
treef55717a0827056168133d7070a90b3a206180265
parentc1659b854437c4fa92cc2693b6c854cc2c4a4277
Fix segfaults on allocation failure (#4)

Throw std::bad_alloc instead of returning nullptr from
ue2::AlignedAllocator. Allocators for STL containers are expected never
to return with an invalid pointer, and instead must throw on failure.
Violating this expectation can lead to invalid pointer dereferences.

Co-authored-by: johanngan <johanngan.us@gmail.com>
fixes github issue #317 (PR #320)
src/util/alloc.h