[BusyBox] patch to login, dmesg and obscure

Vladimir N. Oleynik dzo at simtreas.ru
Mon Jul 28 16:18:34 UTC 2003


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





More information about the busybox mailing list