Re: BUG (fwd)

From: Hades (tourach@cyber1.servtech.com)
Date: 02/11/96


Forwarded message:
> 
> Patch level 8
> BSD OS
> GCC
> no warnings at all, been running for months, and like i said, happens 
> with both my hacked up source, or with a frshly downloaded copy from jhu
> 
> gdb reports:
>  #0 0x5d206464 in null (
>  cannot access memory at address 0x646464c

You are overflowing the variable. I had the SAME exact bug happen when I
tried to stat a mob... I added a lot of stuff to the stat info, and you know
how in so_stat it fills everything into the buf2 (is that right?) variable,
then puts all the info into buf (or did the other imp I work with do this so
we could run a stat through page_string?)

Well anyway, regardless, my mud crashed when I stated a certian mob because
I put more data into the char buf2[MAX_INPUT_LENGTH]; variable than it had
space for. Hence, when it tried to use that data, it crashed.

I suggest making a new char variable of larger size to input the data from,
then check it's length, and if it's longer than MAX_INPUT_LENGTH chop it
down before processing it.

That should fix it, nut then again, I generally hack at code rather than
coding it, so this entire message might have been useless rabbling.

Hades



This archive was generated by hypermail 2b30 : 12/07/00 PST