[comp.sys.amiga.programmer] Bug in sregexp.library

stefanb@messua.informatik.rwth-aachen.de (Stefan Becker) (05/28/91)

Hi!
I got some *SERIOUS* crashes as I used sman. Therefore I started some
debugging tools on my A3000 and found a mungwall hit in the function
freesregexp() of the library. This is caused by a bug in the function
parseone(), which terminates a string with TWO null bytes instead of one. The
following is the diff file which contains the bug fix:

---------------------- cut here --------------------------------------------
*** sregexp.c.orig      Sun May 26 12:36:09 1991
--- sregexp.c   Sun May 26 13:00:46 1991
***************
*** 364,370 ****
                        return NULL;
                    }
                    while (*q++ = onechar(p,FALSE)) ;
!                   *q = 0;
                }
            }
      }
--- 364,370 ----
                        return NULL;
                    }
                    while (*q++ = onechar(p,FALSE)) ;
! /* 26-May-91/SB     *q = 0;  BUG! BUG! BUG! String already null terminated! */
                }
            }
      }
---------------------- cut here --------------------------------------------

I didn't had the time to recompile the library, so here is a patch for the binary
(as posted on comp.sources.amiga) itself:

   File:     sregexp.library
   Length:   8732
   Position: 2206  Old Contents: 0x1CBC 0x0000
                   New Contents: 0x4E71 0x4E71

      Stefan

--
Mail  : Stefan Becker, Holsteinstrasse 9, D-5100 Aachen  ///    Only
Phone : +49-241-505705   FIDO: 2:242/7.6    Germany     ///  Amiga makes
Domain: stefanb@informatik.rwth-aachen.de           \\\///  it possible..
Bang  : ..mcvax!unido!rwthinf!stefanb                \XX/  -->A3000/25<--