bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bugs in id-utils-3.2


From: Ferenc Wagner
Subject: Bugs in id-utils-3.2
Date: 22 Nov 2000 16:16:59 +0100

                Hi there,

I've found some trivial bugs in the subject, or at least I think so.
There's not too much to say, see the diffs below.  Only one thing: my
Linux machine segfaulted on the commands `mkid' and `xtokid', when the
`strtok' library routine tried to chop up the string pointed to by the
static variable `dot'.  I suppose the string literal "." was put into
a read-only memory segment; counterface the `-Wwrite-strings' compiler
option of gcc.  As `strtok' comes to writing the string, it causes
problems.  While `lid' did not segfault, it still seemed to be a good
move for me to change the similar code in `lid.c', too.

I think my modification to `lid.c' in lines 761--765 doesn't solve the
problem with the `search_flinkv' function, but not even understanding
what it does I'd rather leave its further investigation to you...

                                        Cheers: Feri.

diff -r -C 2 id-utils-3.2/src/lid.c id-utils-3.2.p/src/lid.c
*** id-utils-3.2/src/lid.c      Wed Aug  7 04:43:28 1996
--- id-utils-3.2.p/src/lid.c    Wed Nov 22 15:36:44 2000
***************
*** 400,406 ****
    if (argc == 0)
      {
!       static char *dot = (char *) ".";
        argc = 1;
!       argv = ˙
      }
  
--- 400,406 ----
    if (argc == 0)
      {
!       static char dot[] = ".";
        argc = 1;
!       argv[0] = dot;
      }
  
***************
*** 761,765 ****
    unsigned int count;
  
!   if (gets (pattern) == 0)
      return -1;
  
--- 761,765 ----
    unsigned int count;
  
!   if (fgets (pattern, BUFSIZ, stdin) == 0)
      return -1;
  
diff -r -C 2 id-utils-3.2/src/mkid.c id-utils-3.2.p/src/mkid.c
*** id-utils-3.2/src/mkid.c     Tue Jul  9 06:19:09 1996
--- id-utils-3.2.p/src/mkid.c   Wed Nov 22 15:26:05 2000
***************
*** 260,266 ****
    if (argc == 0)
      {
!       static char *dot = (char *) ".";
        argc = 1;
!       argv = ˙
      }
  
--- 260,266 ----
    if (argc == 0)
      {
!       static char dot[] = ".";
        argc = 1;
!       argv[0] = dot;
      }
  
diff -r -C 2 id-utils-3.2/src/xtokid.c id-utils-3.2.p/src/xtokid.c
*** id-utils-3.2/src/xtokid.c   Wed Aug  7 05:14:34 1996
--- id-utils-3.2.p/src/xtokid.c Wed Nov 22 15:26:42 2000
***************
*** 150,156 ****
    if (argc == 0)
      {
!       static char *dot = (char *) ".";
        argc = 1;
!       argv = ˙
      }
  
--- 150,156 ----
    if (argc == 0)
      {
!       static char dot[] = ".";
        argc = 1;
!       argv[0] = dot;
      }
  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]