Hi!

I'm trying to learn more about shared libs so according to the "The ELF
object file by dissection" in Linux Journal (www.ssc.com/lj/issue13) I ve
downloaded the readelf-1.3 utility.

Well.. after folowing the exact example in the article I ended with a
SIGSEGV.

The bug was obvious

[snip]
    fstat(fileno(infile),&statbuf);
    
    if (statbuf.st_size > header_size) {
       header = (char*)realloc(header, statbuf.st_size);
       header_size = statbuf.st_size;
    }
    
    memset(header,0,4096);       //oops what if the file size is < 4096???
[snip]

I also ended with a SIGSEGV when I supplied a non-ELF file as input.

Well - how reliable is this tool and also how have the author's examples 
passed??? 


Thanx for the attention!

        Marin


          -= Why do we need gates in a world without fences? =-

Reply via email to