Bug 4797 - SEGV fault due to NULL pointer deref in dwarf2.c
Summary: SEGV fault due to NULL pointer deref in dwarf2.c
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
Depends on:
Reported: 2007-07-16 23:36 UTC by Doug Kwan
Modified: 2007-07-19 16:52 UTC (History)
1 user (show)

See Also:
Host: i686-linux-gnu
Target: i686-linux-gnu
Build: i686-linux-gnu
Last reconfirmed:

Proposed fix for SEGV problem in dwarf2.c (250 bytes, patch)
2007-07-16 23:38 UTC, Doug Kwan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Doug Kwan 2007-07-16 23:36:47 UTC
nm -l crashes because of a NULL pointer deref in dwarf2.c. functionname_ptr can
be NULL and there are tests in the logic of the function find_line to deal with
that case. Yet, in line 2383 of current top, functionname_ptr is dereference
without check for NULL.

The fix is to check for NULL before using functionname_ptr. I tried a one-line
fix and it seems to work.
Comment 1 Doug Kwan 2007-07-16 23:38:27 UTC
Created attachment 1918 [details]
Proposed fix for SEGV problem in dwarf2.c

Tested this patch in i686-linux-gnu. Looked okay.
Comment 2 Nick Clifton 2007-07-19 16:51:53 UTC
Hi Doug,

  I have applied your patch.

Comment 3 Nick Clifton 2007-07-19 16:52:13 UTC
patch checked in