Vulnerability Development mailing list archives
Re: Administrivia: List Announcement
From: Eric Haugh <haugh () cs ucdavis edu>
Date: Tue, 13 May 2003 14:23:53 -0700
strncpy(buf2, p2, SIZE);Off-by-one. Third arg should be SIZE-1 to leave room for the terminating NULL. This error should lead to a heap based vulnerability when the memory is free()d.
Even if this is changed to: strncpy(buf2, p2, SIZE - 1); it is still not safe, because stnrcpy will not write the terminating NULL character if p2 is of length SIZE - 1 or more. So this can leave the string in buf2 unterminated. It should be: strncpy(buf2, p2, SIZE); // or strncpy(buf2, p2, SIZE - 1), doesn't matter buf2[SIZE - 1] = '\0'; Or better yet: strlcpy(buf2, p2, SIZE); Eric
Current thread:
- Re: vulndev1.c solution (warning SPOILER), (continued)
- Re: vulndev1.c solution (warning SPOILER) Jon Erickson (May 14)
- RE: vulndev1.c solution (warning SPOILER) Cameron Brown (May 15)
- Re: vulndev1.c solution (warning SPOILER) Kenji Cronos (May 15)
- Re: vulndev1.c solution (warning SPOILER) Jon Erickson (May 14)
- Re: vulndev-1 exploit. Joel Eriksson (May 14)
- Re: vulndev-1 exploit. Joel Eriksson (May 14)
- Re: Administrivia: List Announcement xenophi1e (May 13)
- Re: Administrivia: List Announcement Shafik Yaghmour (May 13)
- RE: Administrivia: List Announcement Oliver Lavery (May 13)
- RE: Administrivia: List Announcement Gustavo Scotti (May 13)
- RE: Administrivia: List Announcement Oliver Lavery (May 13)
- Re: Administrivia: List Announcement Eric Haugh (May 13)
- Re: Administrivia: List Announcement Nexus (May 13)
- Re: Administrivia: List Announcement Shafik Yaghmour (May 13)
- Re: Administrivia: List Announcement Thiago Canozzo Lahr (May 13)
- Re: Administrivia: List Announcement Wynn Fenwick (May 13)
- Re: Administrivia: List Announcement Thiago Canozzo Lahr (May 14)
- Re: Administrivia: List Announcement xenophi1e (May 14)
- RE: Administrivia: List Announcement Michael Wojcik (May 14)
