mirror of
https://github.com/ladislav-zezula/StormLib.git
synced 2026-01-21 07:04:29 +01:00
+ Fixed possible buffer overflow in the patching process
This commit is contained in:
@@ -277,6 +277,8 @@ static int ApplyFilePatch_BSD0(
|
||||
|
||||
// Get the longest block that we can combine
|
||||
dwCombineSize = ((dwOldOffset + dwAddDataLength) >= dwOldSize) ? (dwOldSize - dwOldOffset) : dwAddDataLength;
|
||||
if((dwNewOffset + dwCombineSize) > dwNewSize || (dwNewOffset + dwCombineSize) < dwNewOffset)
|
||||
return ERROR_FILE_CORRUPT;
|
||||
|
||||
// Now combine the patch data with the original file
|
||||
for(i = 0; i < dwCombineSize; i++)
|
||||
|
||||
Reference in New Issue
Block a user