Article View: comp.lang.c.moderated
Article #2625Ultimate bug
From: Art Shelest
Date: Fri, 19 Apr 1996 14:30
Date: Fri, 19 Apr 1996 14:30
18 lines
882 bytes
882 bytes
Below is the bug I got to fix last night (in someone else's code).
It's not the actual code, but you'll get the idea:
void* AllocMem( size_t cbMem )
{
void* pMem = malloc( cbMem );
if( pMem )
memset( &pMem, 0, cbMem ); /* note & */
return pMem;
}
I wonder if Lint would ever catch this one.
The net effect that this function would never return (to where it should
return, anyway), ant took good 2 hours to find it in 200K+ lines of code.
_Art.
Technical Details
Message-ID:
<4l881k$76k@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: Artyom@kansmen.com (Art Shelest) Newsgroups: comp.lang.c.moderated Subject: Ultimate bug Date: 19 Apr 1996 09:30:12 -0500 Organization: Kansmen Corp. Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4l881k$76k@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Newsreader: News Xpress Version 1.0 Beta #4