🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by tsmith!graham Tue, 21 Nov 1989 18:17
Dangling pointers in GNU diff3 version 1.7
#553
Author: tsmith!graham
Date: Tue, 21 Nov 1989 18:17
40 lines
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;
        
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads