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 /uncompr.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 'uncompr.c')
| -rw-r--r-- | uncompr.c | 4 |
1 files changed, 4 insertions, 0 deletions
| @@ -33,6 +33,10 @@ int ZEXPORT uncompress2_z(Bytef *dest, z_size_t *destLen, const Bytef *source, | |||
| 33 | const uInt max = (uInt)-1; | 33 | const uInt max = (uInt)-1; |
| 34 | z_size_t len, left; | 34 | z_size_t len, left; |
| 35 | 35 | ||
| 36 | if (sourceLen == NULL || (*sourceLen > 0 && source == NULL) || | ||
| 37 | destLen == NULL || (*destLen > 0 && dest == NULL)) | ||
| 38 | return Z_STREAM_ERROR; | ||
| 39 | |||
| 36 | len = *sourceLen; | 40 | len = *sourceLen; |
| 37 | left = *destLen; | 41 | left = *destLen; |
| 38 | if (left == 0 && dest == Z_NULL) | 42 | if (left == 0 && dest == Z_NULL) |
