From: Stephan Kulow Date: Thu, 8 Nov 2012 02:10:56 +0000 (-0800) Subject: elfutils-0.148-dont-crash.diff X-Git-Tag: accepted/tizen/20130708.234036~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8a91eed1e09e9f2c5fdd3b3a36544af43238e3d;p=platform%2Fupstream%2Felfutils.git elfutils-0.148-dont-crash.diff Avoid crash if the header is 0 --- diff --git a/libdw/dwarf_getcfi_elf.c b/libdw/dwarf_getcfi_elf.c index ba00e05..65d5c71 100644 --- a/libdw/dwarf_getcfi_elf.c +++ b/libdw/dwarf_getcfi_elf.c @@ -76,7 +76,7 @@ parse_eh_frame_hdr (const uint8_t *hdr, size_t hdr_size, GElf_Addr hdr_vaddr, { const uint8_t *h = hdr; - if (*h++ != 1) /* version */ + if (!h || *h++ != 1) /* version */ return (void *) -1l; uint8_t eh_frame_ptr_encoding = *h++;