HomeFreeBSD

elftoolchain nm(1): Initialize allocated memory before use

Description

elftoolchain nm(1): Initialize allocated memory before use

In out of memory scenarios (where one of these allocations failed but
other(s) did not), nm(1) could reference the uninitialized value of these
allocations (undefined behavior).

Always initialize any successful allocations as the most expedient
resolution of the issue. However, I would encourage upstream elftoolchain
contributors to clean up the error path to just abort immediately, rather
than proceeding sloppily when one allocation fails.

Reported by: Coverity
Sponsored by: Dell EMC Isilon

Details

Committed
cemMar 16 2018, 10:25 PM
Parents
rS331077: Add _IOC_NEWLEN() and _IOC_NEWTYPE() macros.
Branches
Unknown
Tags
Unknown