Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug related to random maps....



Peter Mardahl wrote:
> However, all these buffer overruns will still remain lurking
> in the code, perhaps leading to problems.

 Going to dynamic string lengths certainly helps the problem, and is not really
hard to do.  The bigger problem is that you need to check to see if you are
about to overrun the memory you have allocated, which also requires that you
have the length of allocated space (so if you are just passing a pointer of
malloc'd data and that called function does something with the string, it needs
to know the length)

 Right now isn't very good, because there are 3 or 4 different _BUF lengths
defined, and there is no good way to know which one any particular buffer is
using, so you can't really check length against that.