logo       

Re: patch to login, dmesg and obscure: msg#00220

linux.busybox

Subject: Re: patch to login, dmesg and obscure

Ronny,

This start to be realy fun soon... :-) The litte prog below mimics password_check() behaviour and it sure craches on my machine. Howcome? It shouldn't if you're right.

Its not overflow, its bug ;-))

True is:

int main(void) {
const char *old="0123456789";
char *wrapped;
int lenwrap;


lenwrap = strlen(old);
wrapped = malloc(lenwrap * 2 + 1);
strcpy(wrapped, old);


strncat(wrapped+lenwrap, wrapped, lenwrap);
wrapped[lenwrap*2] = 0;
printf("wrapped: %s\n", wrapped);


free(wrapped);
return 0;
}


--w
vodz


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise