[Bug libdw/23301] free on unitialized value

Mark Wielaard mark@klomp.org
Sun Jun 17 18:30:00 GMT 2018


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

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2018-06-17
                 CC|                            |mark at klomp dot org
           Assignee|unassigned at sourceware dot org   |mark at klomp dot org
     Ever confirmed|0                           |1

--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
Created attachment 11076
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11076&action=edit
libdw: Initialize filelist earlier in dwarf_getsrclines.c read_srclines.

Hi,

gcc is wrong, filelist will not be used/freed if nfilelist == 0, and filelist
will be initialized if nfilelist != 0. But this might be hard to see for the
compiler. BTW which gcc version is this, any special CFLAGS used?

Instead of moving the whole block of code around I think just explicitly
setting filelist to NULL when we initialize nfilelist = 0 should do the trick.

Could you test the slightly changed patch attached?

Also would it me OK to add a Signed-off-by: Luiz Angelo Daros de Luca 
<luizluca@gmail.com> line as described in
https://sourceware.org/git/?p=elfutils.git;a=blob_plain;f=CONTRIBUTING;hb=HEAD

Thanks,

Mark

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



More information about the Elfutils-devel mailing list