Avoid overflow in the read file limit check.

This commit is contained in:
Christian Lupien 2005-09-18 11:11:36 +00:00 committed by Alexandre Julliard
parent b3a4b59668
commit 112115bd22
1 changed files with 1 additions and 1 deletions

View File

@ -4746,7 +4746,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context )
/* Some programs pass a count larger than the allocated buffer */
if (DOSVM_IsWin16())
{
WORD maxcount = GetSelectorLimit16( context->SegDs )
DWORD maxcount = GetSelectorLimit16( context->SegDs )
- DX_reg(context) + 1;
if (count > maxcount)
count = maxcount;