From: Sunil N. <su...@su...> - 2012-04-12 09:21:09
|
Hello, According to elf_getdata(3) d_buf can be NULL. This diff checks for d_buf while doing a str_dump. This fixes a crash when dumping .bss in readelf. readelf -p23 readlelf Index: readelf.c =================================================================== --- readelf.c (revision 2487) +++ readelf.c (working copy) @@ -5972,7 +5972,7 @@ elf_errmsg(elferr)); continue; } - if (d->d_size <= 0) + if ((d->d_size <= 0) || (d->d_buf == NULL)) continue; buf_end = (unsigned char *) d->d_buf + d->d_size; start = (unsigned char *) d->d_buf; |