This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libdw/23301] New: free on unitialized value


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

            Bug ID: 23301
           Summary: free on unitialized value
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libdw
          Assignee: unassigned at sourceware dot org
          Reporter: luizluca at gmail dot com
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

Created attachment 11075
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11075&action=edit
patch: dwarf_getsrclines.c: Fix unitialized usage of filelist

I'm getting this error with 0.172:

dwarf_getsrclines.c: In function 'read_srclines':
dwarf_getsrclines.c:1074:7: error: 'filelist' may be used uninitialized in this
function [-Werror=maybe-uninitialized]
       free (filelist);
       ^~~~~~~~~~~~~~~

It seems that gcc is right here as there is "ifs" that go to "out" (where
filelist is freed) before freelist is initialized. I fixed by just moving
filelist initialization to before the first usage of "goto out;". Maybe there
is a more elegant approach.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]