Skip to content

Fix segfaults on allocation failure#320

Closed
johanngan wants to merge 1 commit intointel:masterfrom
johanngan:allocation-failure-fix
Closed

Fix segfaults on allocation failure#320
johanngan wants to merge 1 commit intointel:masterfrom
johanngan:allocation-failure-fix

Conversation

@johanngan
Copy link
Copy Markdown
Contributor

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.

Fixes #317.

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.
fatchanghao pushed a commit that referenced this pull request Apr 21, 2022
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)
markos referenced this pull request in VectorCamp/vectorscan Aug 29, 2022
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)
@hongyang7
Copy link
Copy Markdown
Contributor

Already merged in develop branch

commit id: 7d644e7ba27eaadda753febf0b142faa9affbbca

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.

hs_compile/hs_compile_multi: Allocation failures in ue2::AlignedAllocator can cause segfaults

3 participants