🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Toshiyuki Game Player Ito Mon, 24 Apr 1989 06:42
GNU diff's BUG (on SYSV)
#1570
Author: Toshiyuki Game Player Ito
Date: Mon, 24 Apr 1989 06:42
48 lines
1855 bytes
Dear FSF.

My name is ITO, TOSHIYUKI. 

I installed GNU diff(v.1.4) on SYSV.R2 machine. But It wasn't succeed because
free(2) bug? on SYSV.

I try to

% diff <file> <dir>

Usually it acts diff <file> <dir>/<file> on SYSV and BSD. GNU diff dumps
core(bus error). This bug is caused at line 479 in diff.c

	  free (inf[dir_arg].name);

In this case, inf[dir_arg].name may be argv[1] or argv[2]. So free(2) tries to
free *argv pointer on SYSV, and core dumped later. Because SYSV dose not check
free address.

I patched diff.c. (see below)

*** diff.c	Wed Apr  5 21:10:06 1989
--- ../gdiff/diff.c	Thu Apr 13 13:30:58 1989
***************
*** 292,298 ****
--- 292,302 ----
  
    switch_string = option_list (argv + 1, optind - 1);
  
+ #ifdef USG
+   val = compare_files (0, strcpy((char *) xmalloc(strlen(argv[optind]) + 1), argv[optind]), 0, strcpy((char *) xmalloc(strlen(argv[optind + 1]) + 1), argv[optind + 1]), 0);
+ #else
    val = compare_files (0, argv[optind], 0, argv[optind + 1], 0);
+ #endif
  
    /* Print any messages that were saved up for last.  */
    print_message_queue ();

I hope, this bug will be fixed, Thank you.

---------
          ITO, TOSHIYUKI
Office:   INFORMATION SYSTEMS & ELECTRONICS DEVELOPMENT LAB.
          MITSUBISHI ELECTRIC CORPORATION
Address:  5-1-1 OFUNA KAMAKURA 247, JAPAN
PHONE:    +81-467-44-9084
E-mail:   toshi%isl.melco.co.jp@uunet.uu.net
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