Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1519072 - NULL pointer dereference in the read_dwarf() function
Summary: NULL pointer dereference in the read_dwarf() function
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dwz
Version: 28
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2017-11-30 03:33 UTC by Jonghyuk Song
Modified: 2018-02-20 15:33 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:

Attachments (Terms of Use)
causing NULL pointer dereference (deleted)
2017-11-30 03:33 UTC, Jonghyuk Song
no flags Details

Description Jonghyuk Song 2017-11-30 03:33:19 UTC
Created attachment 1360667 [details]
causing NULL pointer dereference

Description of problem:
dwz makes segmentation fault running with the attached file.
In read_dwarf(), 
at 9880 line, strptr() can return NULL, but it does not check.
So, when strptr() return NULL, it makes segfault at strncmp()(9883 line)

Version-Release number of selected component (if applicable):
dwz version 0.12

How reproducible:

Steps to Reproduce:
1. git clone git://
2. add " LDFLAGS=-fno-omit-frame-pointer -fsanitize=address -fPIC -lasan " in Makefile
3. make
4. ./dwz crash1(attached file)

Additional info:
$ ./dwz ../o_dwz_20171129/crashes/crash2 
==28458==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000048d536 bp 0x000000000000 sp 0x7ffed0ee2780 T0)
    #0 0x48d535 in read_dwarf /home/jhsong/fuzzing/dwz/dwz.c:9883
    #1 0x490148 in dwz /home/jhsong/fuzzing/dwz/dwz.c:11055
    #2 0x404a59 in main /home/jhsong/fuzzing/dwz/dwz.c:11876
    #3 0x7f836357b82f in __libc_start_main (/lib/x86_64-linux-gnu/
    #4 0x405648 in _start (/home/jhsong/fuzzing/dwz/dwz+0x405648)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/jhsong/fuzzing/dwz/dwz.c:9883 read_dwarf

Comment 1 Fedora End Of Life 2018-02-20 15:33:57 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Note You need to log in before you can comment on or make changes to this bug.