Bugtraq mailing list archives

Re: WuFTPD: Providing *remote* root since at least1994


From: luci () WILD TRANSART RO (Hudin Lucian)
Date: Thu, 29 Jun 2000 23:30:25 +0300


Actually many people blame sprintf usage as a potential source
for buffer overflow exploits, yet :

char buff[BUFSIZ];
sprintf(buff, "%.*s", BUFSIZ, "string");

avoids the overflow ... IMHO it's very easy to avoid buffer overflows when
writing critical programs just by keeping in mind the 5th of "the ten C
commandments", just in case you forgot it :

 5. Thou shalt check the array bounds of all strings (indeed, all
arrays), for surely where thou typest "foo" someone someday shall type
"supercalifragilisticexpialidocious".

Regards, LucySoft


Current thread: