https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a0c33934fc4fb6dbc89b89271608018767c4101e

commit a0c33934fc4fb6dbc89b89271608018767c4101e
Author:     Pierre Schweitzer <pie...@reactos.org>
AuthorDate: Fri Nov 16 21:12:10 2018 +0100
Commit:     Pierre Schweitzer <pie...@reactos.org>
CommitDate: Fri Nov 16 22:07:08 2018 +0100

    [NTOSKRNL] Properly check for negative values in IoCheckEaBufferValidity()
    
    CID 1441355, 1441382
---
 ntoskrnl/io/iomgr/util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ntoskrnl/io/iomgr/util.c b/ntoskrnl/io/iomgr/util.c
index fb56f8d170..5005e18208 100644
--- a/ntoskrnl/io/iomgr/util.c
+++ b/ntoskrnl/io/iomgr/util.c
@@ -228,7 +228,7 @@ IoCheckEaBufferValidity(IN PFILE_FULL_EA_INFORMATION 
EaBuffer,
         if (NextEntryOffset == 0)
         {
             /* If we don't overflow! */
-            if (EaLength - ComputedLength < 0)
+            if ((LONG)(EaLength - ComputedLength) < 0)
             {
                 goto FailPath;
             }
@@ -243,7 +243,7 @@ IoCheckEaBufferValidity(IN PFILE_FULL_EA_INFORMATION 
EaBuffer,
         }
 
         /* Check next entry offset value is positive */
-        if (NextEntryOffset < 0)
+        if ((LONG)NextEntryOffset < 0)
         {
             goto FailPath;
         }

Reply via email to