Opened 8 years ago

Closed 8 years ago

#10058 closed Bugs (fixed)

Null pointer access in once

Reported by: michael.kaes@… Owned by: viboes
Milestone: Boost 1.56.0 Component: thread
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

There is the possibility that the call to malloc in

thread_detail::uintmax_atomic_t& get_once_per_thread_epoch()

in the file once.cpp returns null.

This would lead to undefined behavior as this pointer is later on dereferenced.

Attached is a patch that adds a check for the null pointer and throws an exception in this case.

Attachments (1)

once_possible_null_pointer.patch (1.0 KB ) - added by michael.kaes@… 8 years ago.
Patch agains the current git repo

Download all attachments as: .zip

Change History (4)

by michael.kaes@…, 8 years ago

Patch agains the current git repo

comment:1 by viboes, 8 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned
Note: See TracTickets for help on using tickets.