[UDFS] Don't access OldInIcb after being freed
authorVictor Martinez <vicmarcal@gmail.com>
Sat, 17 Aug 2019 12:52:19 +0000 (15:52 +0300)
committerVictor Perevertkin <victor@perevertkin.ru>
Sat, 17 Aug 2019 13:49:11 +0000 (16:49 +0300)
CORE-11199

drivers/filesystems/udfs/udf_info/udf_info.cpp

index 38576be..6778cf7 100644 (file)
@@ -1719,8 +1719,8 @@ UDFWriteFile__(
             }
         }
         if(OldInIcb) {
             }
         }
         if(OldInIcb) {
-            MyFreePool__(OldInIcb);
             UDFWriteExtent(Vcb, &(Dloc->DataLoc), 0, (uint32)OldLen, FALSE, OldInIcb, &_WrittenBytes);
             UDFWriteExtent(Vcb, &(Dloc->DataLoc), 0, (uint32)OldLen, FALSE, OldInIcb, &_WrittenBytes);
+            MyFreePool__(OldInIcb);
         }
         if((int64)OldLen != Dloc->DataLoc.Length) {
             // restore file size
         }
         if((int64)OldLen != Dloc->DataLoc.Length) {
             // restore file size