HomeFreeBSD

MFC r331078 (cem): nm: Initialize allocated memory before use

Description

MFC r331078 (cem): nm: 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.

Details

Provenance
emasteAuthored on
Parents
rS340305: MFC r337287:
Branches
Unknown
Tags
Unknown