bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/17531] readelf crashes on fuzzed samples


From: joseph at codesourcery dot com
Subject: [Bug binutils/17531] readelf crashes on fuzzed samples
Date: Mon, 12 Jan 2015 19:05:51 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=17531

--- Comment #69 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
On Mon, 12 Jan 2015, cvs-commit at gcc dot gnu.org wrote:

>         (xcalloc2): New function.  Like xcalloc, but checks for overflow.
>         * dwarf.h (xcalloc2): Prototype.

This should not be needed.  xcalloc calls calloc, which should check for 
overflow itself.  I see libiberty has a broken version of calloc, but 
since calloc is a C89 function no modern system should be using 
libiberty's version.  If we wish to allow for systems with broken calloc, 
libiberty's configure should detect such systems (based on a blacklist of 
broken systems) and substitute a working calloc.

(On the other hand, all the allocation macros in libiberty.h that do 
multiplications do need replacing by versions that check for overflow - 
that is, the existing macros need to be made to check for overflow, rather 
than having separate checking and non-checking versions.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]