diff options
| author | gaoshutao <1779227906@qq.com> | 2025-08-25 15:38:00 +0800 |
|---|---|---|
| committer | Mark Adler <git@madler.net> | 2026-02-11 11:51:20 -0800 |
| commit | 5c47755331cb7354133b82f357ed767578c95649 (patch) | |
| tree | c180103b055fd1feb3e9904e61a070c3ffd8f83e /compress.c | |
| parent | d37e27eef65c6249631e8757601c43e813ded155 (diff) | |
| download | zlib-5c47755331cb7354133b82f357ed767578c95649.tar.gz zlib-5c47755331cb7354133b82f357ed767578c95649.tar.bz2 zlib-5c47755331cb7354133b82f357ed767578c95649.zip | |
Check for invalid NULL pointer inputs to zlib operations.
Diffstat (limited to 'compress.c')
| -rw-r--r-- | compress.c | 4 |
1 files changed, 4 insertions, 0 deletions
| @@ -28,6 +28,10 @@ int ZEXPORT compress2_z(Bytef *dest, z_size_t *destLen, const Bytef *source, | |||
| 28 | const uInt max = (uInt)-1; | 28 | const uInt max = (uInt)-1; |
| 29 | z_size_t left; | 29 | z_size_t left; |
| 30 | 30 | ||
| 31 | if ((sourceLen > 0 && source == NULL) || | ||
| 32 | destLen == NULL || (*destLen > 0 && dest == NULL)) | ||
| 33 | return Z_STREAM_ERROR; | ||
| 34 | |||
| 31 | left = *destLen; | 35 | left = *destLen; |
| 32 | *destLen = 0; | 36 | *destLen = 0; |
| 33 | 37 | ||
