Kod: Zaznacz cały
*** glibc detected *** ./browser: malloc(): memory corruption: 0x08c594d8 ***
======= Backtrace: =========
/lib/libc.so.6(+0x6c501)[0xb7653501]
/lib/libc.so.6(+0x6f2fc)[0xb76562fc]
/lib/libc.so.6(__libc_calloc+0xb2)[0xb7657682]
/lib/libncurses.so.5(_nc_setupterm+0x7d)[0xb7768afd]
/lib/libncurses.so.5(newterm+0x84)[0xb7758284]
/lib/libncurses.so.5(initscr+0x75)[0xb7754be5]
./browser[0x8048b3f]
/lib/libc.so.6(__libc_start_main+0xe7)[0xb75fdce7]
./browser[0x8048831]
======= Memory map: ========
itd.
Kod: Zaznacz cały
while( (len=recv(sockfd, buf, 50, 0)) != 0)
{
if( len == -1 )
{
perror("recv");
exit(1);
}
buf[len]='\0';
strcat(page, buf);
}
printf("Display page %s\n", argv[2]);
initscr();