[NTOSKRNL] Properly check for negative values in IoCheckEaBufferValidity()
authorPierre Schweitzer <pierre@reactos.org>
Fri, 16 Nov 2018 20:12:10 +0000 (21:12 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Fri, 16 Nov 2018 21:07:08 +0000 (22:07 +0100)
CID 14413551441382

ntoskrnl/io/iomgr/util.c

index fb56f8d..5005e18 100644 (file)
@@ -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;
         }