Re: [hatari-devel] asm56000.ttp problem

[ Thread Index | Date Index | More Archives ]

Thorsten Otto schrieb:

> Yes, there is an assert in that function, but if the library was compiled with 
> NDEBUG it will just continue. Current mintlib seems to be safe in that regard.
> And if you look at _write: that function rejects handles >= __NHANDLES. That 
> explains why the file is created, but nothing written to it. So my previous 
> assumption was wrong: the bug is in the library.

In the meantime, I have come to the same conclusion. read() and close()
will more or less work with handles >= 40, while write() rejects them
and open() (without the assert) writes past the end of the array.

I have thus patched open() and write() with a hex-editor. With the
attached ASM56000.TTP the compilation process runs through without
errors or crashes on Hatari's GEMDOS HD. I'll let Miro judge whether the
output is as expected.

Note that this is a very dirty patch of ASM56000.TTP. After all,
__open_stat is used for a reason. E.g. my patched write() function will
fail with O_APPEND.

This also means that there will be more programs (using the same
standard library) with a similar problem.

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

Description: Zip compressed data

Mail converted by MHonArc 2.6.19+