|
|||||||||||
|
Re: Administrivia: List Announcement
From: Brian Hatch <vuln-dev(at)ifokr.org>
Date: Tue May 13 2003 - 13:45:21 EDT Fail to verify buf1 and buf2 != NULL after malloc. (and why not just use 'char buf1[SIZE]; and char buf2[SIZE];' ?? char *buf1 = (char*)malloc( SIZE * sizeof(char) ); strncpy doesn't null terminate if strlen(p2) > SIZE. (Not necessarily an issue for this dinky program.) > for (i = 0; i <= SIZE && p1[i] != '\0'; i++)
Why not NULL terminate buf1?
Assume the user makes the malloc fail by setting nasty process limits. Thus buf1 and buf2 don't have SIZE bytes at all, yet we copy into the locations they would be. Voila - overflow. Or, since we're free'ing a memory location that was never malloc'd, it's kind of like a double free bug (though since it was never malloc'd properly in the first place, perhaps it needs a better name.) -- Brian Hatch Time exists solely Systems and for the purpose of Security Engineer preventing everything www.hackinglinuxexposed.com from happening at once. Every message PGP signed
This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:39 EDT |
||||||||||
|
|||||||||||