Article View: gnu.utils.bug
Article #553Dangling pointers in GNU diff3 version 1.7
From: tsmith!graham
Date: Tue, 21 Nov 1989 18:17
Date: Tue, 21 Nov 1989 18:17
40 lines
1874 bytes
1874 bytes
While porting GNU diff3 version 1.7 to MS-DOS, I came across a couple
of places where pointers were not being initialized. I didn't follow the
code close enough to know whether both of the following fixes are
required, but certainly at least one of them is. The bug probably doesn't
show up under UNIX, because space which is mallocated for the first
time, will normally contain 0 anyway.
Doug.
...!uunet!mitel!sce!tsmith!graham
P.S.
Is it appropriate to post bug reports of this sort to gnu.utils.bug
on Usenet? I know that other people have attempted to do ports to
DOS, and information of this sort could be useful to them as well.
Or do they just have to wait 'till version 1.8 arrives, and try again?
--------------------------------------------------------------------
*** diff3.old Sat Apr 08 12:56:10 1989
--- diff3.c Tue Nov 21 05:01:30 1989
***************
*** 806,811 ****
--- 806,812 ----
struct diff3_block *result = ALLOCATE (1, struct diff3_block);
int numlines;
+ D_NEXT (result) = (struct diff3_block *)0;
D3_TYPE (result) = ERROR;
/* Assign ranges */
***************
*** 913,918 ****
--- 914,920 ----
while (scan_diff - diff_contents < diff_size)
{
bptr = ALLOCATE (1, struct diff_block);
+ bptr->next = (struct diff_block *)0;
bptr->lines[0] = bptr->lines[1] = (char **) 0;
bptr->lengths[0] = bptr->lengths[1] = (int *) 0;
Technical Details
Message-ID:
<8911211750.AA03136@tsmith.uucp>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!brutus.cs.uiuc.edu!usc!cs.utexas.edu!tut.cis.ohio-state.edu!ai.mit.edu!tsmith!grahamShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!brutus.cs.uiuc.edu!usc!cs.utexas.edu!tut.cis.ohio-state.edu!ai.mit.edu!tsmith!graham From: tsmith!graham@ai.mit.edu Newsgroups: gnu.utils.bug Subject: Dangling pointers in GNU diff3 version 1.7 Message-ID: <8911211750.AA03136@tsmith.uucp> Date: 21 Nov 89 18:17:00 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 40