You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* pcompress/zlib: Check for correct return values.
deflate and inflate with Z_FINISH return Z_STREAM_END on success.
All other cases imply that an error occurred or that not enough
output space was available. These cases should be treated as
errors because:
- deflateBound specifies max amount of output bytes to expect
- inflate takes length from message into account
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* pcompress/zlib: Use correct data types.
On 64 bit systems size_t is larger than uint32_t. This means that
performing a memcpy() with sizeof(uint32_t) truncates the value.
Also avoid signed data types when unsigned types are better suited.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* pcompress/zlib: Correctly terminate string.
Right now each successful operation leads to out of boundary heap
access by not dereferencing the double pointer outstring.
This is supposed to terminate the string with a '\0', not setting
a char pointer to NULL.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* pcompress/zlib: Validate input length.
Check that input length is not UINT32_MAX to avoid integer overflow.
If such an overflow occurs, a malicious peer could trigger an out of
boundary heap access when terminating the string with a nul byte.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
0 commit comments