Re: Memory corruption in file_to_string and file_to_string_alloc?

From: Artovil (artovil@arcanerealms.org)
Date: 11/13/01


At 08:20 2001-11-13 -0600, Mike Breuer wrote:
>----- Original Message -----
>From: "Artovil" <artovil@ARCANEREALMS.ORG>
>
>
> > ....I noticed that the mud SIGSEGV's when I view a text
> > file in the mud, and then reload any of the textfiles.
> >
> >  > credits
> > ...
> >  > reload imotd
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x808ba15 in file_to_string_alloc (name=0x80f85bf "text/credits",
> > buf=0x81164bc) at db.c:3238
> > 3238        if (in_use->showstr_vector && *in_use->showstr_vector == *buf)
>
>Looks like a bug to me alright.  Most places in the code use showstr_count
>to determine whether showstr_vector is valid.  So if you want to be
>consistent, change the above line to:
>
>     if (in_use->showstr_count && *in_use->showstr_vector == *buf)

The showstr_count instead of showstr_vector worked perfectly fine for
me!  I think I will leave it at that, and see if it remains stable...
Thanks for the quick reply, Mike!

Kind regards,
Torgny

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST