Segmentation fault w/ Gnats 4.0.1

Pankaj Garg <[email protected]> Thu, 18 Nov 2004 09:04:44 -0800
Newsgroups gmane.comp.bug-tracking.gnats.bugs
Message-ID <[email protected]>
I recently downloaded Gnats 4.0.1 and installed it on a
vine linux (vinelinux.org) and got a segmentation fault
while the gnats server was initializing.

It seems the error occurs when gnatds is trying to
read the 'responsbile' file. I hacked a fix
by using the following change:

--- mail.c      2002-11-25 22:58:33.000000000 +0900
+++ ../../gnats-4.0.1.new/gnats/mail.c  2004-11-17 07:07:14.000000000=20
+0900
@@ -231,7 +231,10 @@ getOneAddress (const char **addrPtr)
        addr--;
      }

-  res =3D xstrndup (addrStart, addr - addrStart);
+  if (addr <=3D addrStart)
+    res =3D NULL;
+  else
+    res =3D xstrndup (addrStart, addr - addrStart);

    *addrPtr =3D (*addrEnd =3D=3D '\0') ? NULL : addrEnd+1;
    return res;

  Haven't had a chance to explore further, but it seems that
the problem was happening when there was only an '\n' for
the third field (address) in the responsible file. Seems like the
isspace logic is somehow getting messed up. Before I dig deeper,
just wanted to see if someone else has experienced anything like this.

Pankaj


  --
  Pankaj K Garg =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
[email protected]
  1684 Nightingale Avenue =A0 =A0=A0408-373-4027
  Suite 201 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0      =
408-733-2737(fax)
  Sunnyvale, CA 94087            http://www.zeesource.net