Fix null pointer addition

This commit is contained in:
Nick Terrell
2019-11-20 18:36:04 -08:00
parent 2d4dcce55f
commit 659e9f05cf
8 changed files with 83 additions and 24 deletions
+1 -1
View File
@@ -660,7 +660,7 @@ ZSTD_compressBlock_lazy_generic(
const U32 dictIndexDelta = dictMode == ZSTD_dictMatchState ?
prefixLowestIndex - (U32)(dictEnd - dictBase) :
0;
const U32 dictAndPrefixLength = (U32)(ip - prefixLowest + dictEnd - dictLowest);
const U32 dictAndPrefixLength = (U32)((ip - prefixLowest) + (dictEnd - dictLowest));
/* init */
ip += (dictAndPrefixLength == 0);