Re: Buffer overrun

From: Gary Barnett (gbarnett@POLARNET.COM)
Date: 08/19/97


On Tuesday, August 19, 1997 5:59 PM, George
[SMTP:greerga@DRAGON.HAM.MUOHIO.EDU] wrote:
> NOTE: Although it says to allocate 10 bytes, the smallest buffer I have it
> give out is 128 bytes.  The sprintf() writes more than 128 bytes though.
>
<snip>

> Not too shabby...although the segmentation fault would be neat to avoid...
> Time to go look into that. :)
>

how about using an snprintf using the original buffer limit as the
max_to_copy.

Wouldn't that cure the crash, assuming the program wasn't destined to crash
due to stack corruption?

I would rather still have the mud exit, as opposed to warn and continue, as
you
are begging for an overflow that will result in bad data getting saved to
disk by
olc, boards, etc. That is my chief worry about these kinds of problems.

Your buffer system promises to help quite a bit in the search for high
uptime.

Good work!

--Mallory

I can picture in my mind a world without war, a world without hate.
And I can picture us attacking that world, because they'd never
expect it.     - Jack Handey


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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