Re: [hatari-devel] Buffer overflow in Paths_Init()

[ Thread Index | Date Index | More Archives ]

Eero Tamminen schrieb:

> I've always though Linux has better / more accessible ones, but
> strangely enough e.g. Valgrind doesn't complain about this.
> Or did you mean that heap debugging is enabled by default?
> (Glibc has some heap corruption checks always enabled, and Linux
> distros enable by default some GCC checks for all packages, but
> these are pretty lightweight.)

As Thomas pointed out, there probably is no actual buffer overflow with
Linux, which is why runtime corruption checks (like Windows probably
also does) will not detect this fault. A good static code analysis tool
could probably find out that File_MakeAbsoluteName does a strcpy from a
potentially bigger buffer into a smaller one.

> Attached is patch for you to test.

Sorry, but I don't have the build environment to compile Hatari from
source code. I have, however, verified by patching the binary with a
hex-editor that the crash goes away if I increase the memory allocated
for sDataDir. Therefore, I'm confident your patch will work as well.

Christian Zietz  -  CHZ-Soft  -  czietz@xxxxxxx
PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA

Mail converted by MHonArc 2.6.19+