Description
A race condition exists between inflate operations and disposal. Inflater synchronizes reads with SyncLock, but Dispose() is not synchronized, allowing the underlying zlib state to be released while an inflate call is in progress, leading to possible crashes.
Reproduction Steps
Attempt multiple Read and Dispose operations on the same DeflateStream.
Expected behavior
Dispose should not be able to release the native inflater state while an inflate call is in progress.
Actual behavior
Concurrent Read and Dispose can result in invalid native state being used during decompression.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Description
A race condition exists between inflate operations and disposal. Inflater synchronizes reads with SyncLock, but Dispose() is not synchronized, allowing the underlying zlib state to be released while an inflate call is in progress, leading to possible crashes.
Reproduction Steps
Attempt multiple Read and Dispose operations on the same DeflateStream.
Expected behavior
Dispose should not be able to release the native inflater state while an inflate call is in progress.
Actual behavior
Concurrent Read and Dispose can result in invalid native state being used during decompression.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response