Merge pull request #964 from sigiesec/fix-ubsan-resetStreamHC_fast
Don't trigger UBSan warning in LZ4_resetStreamHC_fast if LZ4_streamHC…
This commit is contained in:
commit
a8e888774a
@ -1031,7 +1031,11 @@ void LZ4_resetStreamHC_fast (LZ4_streamHC_t* LZ4_streamHCPtr, int compressionLev
|
||||
LZ4_initStreamHC(LZ4_streamHCPtr, sizeof(*LZ4_streamHCPtr));
|
||||
} else {
|
||||
/* preserve end - base : can trigger clearTable's threshold */
|
||||
if (LZ4_streamHCPtr->internal_donotuse.end != NULL) {
|
||||
LZ4_streamHCPtr->internal_donotuse.end -= (uptrval)LZ4_streamHCPtr->internal_donotuse.base;
|
||||
} else {
|
||||
assert(LZ4_streamHCPtr->internal_donotuse.base == NULL);
|
||||
}
|
||||
LZ4_streamHCPtr->internal_donotuse.base = NULL;
|
||||
LZ4_streamHCPtr->internal_donotuse.dictCtx = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user