]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix Coverity warnings. 67/head
authorMika Lindqvist <postmaster@raasu.org>
Tue, 26 Apr 2016 10:04:50 +0000 (13:04 +0300)
committerMika Lindqvist <postmaster@raasu.org>
Wed, 27 Apr 2016 10:15:15 +0000 (13:15 +0300)
arch/x86/deflate_quick.c
test/minigzip.c

index 3088200ea04999c87fe044dc2e01a812e6441a3b..b5190d59898411a83d1af594c899ad01e11419cb 100644 (file)
@@ -220,6 +220,9 @@ ZLIB_INTERNAL block_state deflate_quick(deflate_state *s, int flush) {
                     if (match_len > s->lookahead)
                         match_len = s->lookahead;
 
+                    if (match_len > MAX_MATCH)
+                        match_len = MAX_MATCH;
+
                     static_emit_ptr(s, match_len - MIN_MATCH, s->strstart - hash_head);
                     s->lookahead -= match_len;
                     s->strstart += match_len;
index 15f170404e6a6f81221c956955fe7054a17cb0e2..9c71fd1b8d5f02c66e028cd43e7f5c5c2396648e 100644 (file)
@@ -65,13 +65,13 @@ void myfree (void *, void *);
 
 void *myalloc(void *q, unsigned n, unsigned m)
 {
-    q = Z_NULL;
+    (void)q;
     return calloc(n, m);
 }
 
 void myfree(void *q, void *p)
 {
-    q = Z_NULL;
+    (void)q;
     free(p);
 }