🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.d
Article #1769

Re: tgif core dumps all the time -- just mine?

#1769
From: Alastair Rae
Date: Wed, 17 Apr 1991 13:55
48 lines
1819 bytes
Thanks to all who replied to my original posting. Buggie calls to calloc 
were causing corruption.

I've had a patch from Wayne Richardson <wdr@ibm.com>:

-------------------------

*** msg.c.old	Tue Apr  2 01:16:27 1991
--- msg.c	Fri Apr 12 16:49:25 1991
***************
*** 39,45 ****

     if (*Msg == '\0') { topMsgNumber = msgCount; return; }

!    s = (char *) calloc (strlen (Msg), sizeof(char));
     msg_ptr = (struct MsgRec *) calloc (1, sizeof(struct MsgRec));

     strcpy (s, Msg);
--- 39,45 ----

     if (*Msg == '\0') { topMsgNumber = msgCount; return; }

!    s = (char *) calloc (1+strlen (Msg), sizeof(char));
     msg_ptr = (struct MsgRec *) calloc (1, sizeof(struct MsgRec));

     strcpy (s, Msg);
*** xbitmap.c.old	Wed Apr  3 16:57:09 1991
--- xbitmap.c	Fri Apr 12 16:51:50 1991
***************
*** 298,304 ****

     pixelValue[0] = myBgPixel;
     colorChar[0] = '`';
!    colorStr[0] = (char *) calloc (strlen(myBgColorStr), sizeof(char));
     strcpy (colorStr[0], myBgColorStr);
     numColorsToDump = 1;

--- 298,304 ----

     pixelValue[0] = myBgPixel;
     colorChar[0] = '`';
!    colorStr[0] = (char *) calloc (1+strlen(myBgColorStr), sizeof(char));
     strcpy (colorStr[0], myBgColorStr);
     numColorsToDump = 1;


-- 
Alastair Rae : uunet!ukc!mcdd1!ar : +44 442 272071 : *Usual disclaimer* 
Technical Details
Message-ID: <151@mx-1>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!bionet!agate!ucbvax!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!mcdd1!ar
References: <150@mx-1>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!bionet!agate!ucbvax!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!mcdd1!ar
From: ar@mcdd1 (Alastair Rae)
Newsgroups: comp.sources.d
Subject: Re: tgif core dumps all the time -- just mine?
Summary: patch
Keywords: tgif bugs patch
Message-ID: <151@mx-1>
Date: 17 Apr 91 13:55:18 GMT
References: <150@mx-1>
Organization: McDonnell Douglas, Hemel Hempstead, Herts, UK
Lines: 48