This is the mail archive of the
mailing list for the GDB project.
Re: segmentation fault
Oliver Block escribiÃ:
(gdb) p sizeof(struct servent)
$1 = 16
When I extract
sptr = (struct servent *) 0x804b028
r = 0x804b030
as servent has a size of 16 bytes
804b028 + 16 = 0x804b038
These two variables seem to overlap. Do you agree?
Maybe I'm wrong, but sptr is a pointer, so it uses 0x804b028 and 0x804b029.
The memory pointed by this pointer is the one that has size 16.