[hatari-devel] asm56000.ttp problem

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Thorsten Otto schrieb:

> I don't think that this can easily be done. __NHANDLES is also used to set up 
> an array of struct __open_file __open_stat[]. If you change the compares to 
> accept higher values, certain function will suddenly write beyond the end of 
> that array.

And this is precisely what appens within the open() call in asm56000:
Given a file handle>=40 it will write past the end of __open_stat, as I
have verified with the Hatari debugger. The effects will of course vary
depending on which variables are overwritten.

> BTW., current mintlib still suffers from the same problem: the handle returned 
> by GEMDOS is used as an index into that array (offset by 3, to take into 
> account valid negative handles). Since other programs compiled with current 
> versions of mintlib don't seem to have that problem

Well, in current mintlib, someone put a "if (__OPEN_INDEX(rv) <
__NHANDLES)" into open.c before accessing __open_stat. I assume that
similar checks were added to all other functions accessing __open_stat.
That explains why programs using current mintlib are not crashing with
Harari's GEMDOS HD.

Christian
-- 
Christian Zietz  -  CHZ-Soft  -  czietz@xxxxxxx
WWW: http://www.chzsoft.de/
PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/