aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compress.c4
-rw-r--r--gzlib.c2
-rw-r--r--uncompr.c4
3 files changed, 9 insertions, 1 deletions
diff --git a/compress.c b/compress.c
index 0c809880..410d6e50 100644
--- a/compress.c
+++ b/compress.c
@@ -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
diff --git a/gzlib.c b/gzlib.c
index 65a0b497..934688c5 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -93,7 +93,7 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
93#endif 93#endif
94 94
95 /* check input */ 95 /* check input */
96 if (path == NULL) 96 if (path == NULL || mode == NULL)
97 return NULL; 97 return NULL;
98 98
99 /* allocate gzFile structure to return */ 99 /* allocate gzFile structure to return */
diff --git a/uncompr.c b/uncompr.c
index 8f7438ee..14ef96ce 100644
--- a/uncompr.c
+++ b/uncompr.c
@@ -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)