Bug 458666 - NULL pointer is dereferenced in symbols_elf.c
Summary: NULL pointer is dereferenced in symbols_elf.c
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Agent (show other bugs)
Version: 1.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.3   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-28 12:42 EST by Manuel Coutand CLA
Modified: 2015-06-16 03:17 EDT (History)
1 user (show)

See Also:


Attachments
proposed patch (1.08 KB, patch)
2015-01-28 12:42 EST, Manuel Coutand CLA
mober.at+eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Coutand CLA 2015-01-28 12:42:25 EST
in symbols_elf.c

in find_symbol_by_addr() a call is made to find_by_addr_in_unit() 
if ip.unit == NULL a NULL pointer can be passed as ip
find_by_addr_in_unit() calls check_in_range(parent, ip)
in check_in_range() ip (then) is used as a pointer and is dereferenced. It can't be NULL.
Comment 1 Manuel Coutand CLA 2015-01-28 12:42:51 EST
Created attachment 250314 [details]
proposed patch

attached is a proposed patch for the issue
Comment 2 Eugene Tarassov CLA 2015-01-28 14:12:13 EST
I committed a different fix - we have to call find_by_addr_in_unit() even if ip.uint == NULL. I also added a test for such case.

Fixed.
Thanks!
Comment 3 Martin Oberhuber CLA 2015-03-16 12:18:16 EDT
Comment on attachment 250314 [details]
proposed patch

Setting iplog- since the attached patch was not used.