From: Aleksandar Andrejevic Date: Mon, 30 Sep 2013 03:10:38 +0000 (+0000) Subject: [SOFT386] X-Git-Tag: backups/0.3.17@66124~1365^2~408 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=1294b156ea7c1b685f021384ed814d80fe1661bd [SOFT386] Fix previous fix. svn path=/branches/ntvdm/; revision=60468 --- diff --git a/lib/soft386/common.c b/lib/soft386/common.c index 492eebd203c..238da7a9108 100644 --- a/lib/soft386/common.c +++ b/lib/soft386/common.c @@ -50,7 +50,7 @@ Soft386ReadMemory(PSOFT386_STATE State, /* Get the cached descriptor */ CachedDescriptor = &State->SegmentRegs[SegmentReg]; - if ((Offset + Size) > CachedDescriptor->Limit) + if ((Offset + Size - 1) > CachedDescriptor->Limit) { /* Read beyond limit */ Soft386Exception(State, SOFT386_EXCEPTION_GP); @@ -190,7 +190,7 @@ Soft386WriteMemory(PSOFT386_STATE State, /* Get the cached descriptor */ CachedDescriptor = &State->SegmentRegs[SegmentReg]; - if ((Offset + Size) >= CachedDescriptor->Limit) + if ((Offset + Size - 1) > CachedDescriptor->Limit) { /* Write beyond limit */ Soft386Exception(State, SOFT386_EXCEPTION_GP);