|
|
04f4ee |
From f776e1609cc63bf486634ee9bc6226dac2c0d2f3 Mon Sep 17 00:00:00 2001
|
|
|
04f4ee |
From: Ondrej Dubaj <odubaj@redhat.com>
|
|
|
04f4ee |
Date: Tue, 15 Oct 2019 11:27:15 +0200
|
|
|
04f4ee |
Subject: [PATCH] fixed covscan issues
|
|
|
04f4ee |
|
|
|
04f4ee |
|
|
|
04f4ee |
crc32.c | 2 +-
|
|
|
04f4ee |
deflate.c | 2 +-
|
|
|
04f4ee |
test/crc32_test.c | 8 ++++----
|
|
|
04f4ee |
3 files changed, 6 insertions(+), 6 deletions(-)
|
|
|
04f4ee |
|
|
|
04f4ee |
diff
|
|
|
04f4ee |
index 406d350..34132ea 100644
|
|
|
04f4ee |
|
|
|
04f4ee |
|
|
|
04f4ee |
@@ -302,7 +302,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
|
|
|
04f4ee |
|
|
|
04f4ee |
if (!crc32_func)
|
|
|
04f4ee |
crc32_func = crc32_z_ifunc();
|
|
|
04f4ee |
- return (*crc32_func)(crc, buf, len);
|
|
|
04f4ee |
+ return (*crc32_func)(crc, buf, len);
|
|
|
04f4ee |
}
|
|
|
04f4ee |
|
|
|
04f4ee |
#endif
|
|
|
04f4ee |
diff
|
|
|
04f4ee |
index 089285a..9b09718 100644
|
|
|
04f4ee |
|
|
|
04f4ee |
|
|
|
04f4ee |
@@ -1015,7 +1015,7 @@ int ZEXPORT deflate (strm, flush)
|
|
|
04f4ee |
*/
|
|
|
04f4ee |
if (strm->avail_in != 0 || s->lookahead != 0 ||
|
|
|
04f4ee |
(flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
|
|
|
04f4ee |
- block_state bstate;
|
|
|
04f4ee |
+ block_state bstate = 0;
|
|
|
04f4ee |
|
|
|
04f4ee |
bstate = DEFLATE_HOOK(strm, flush, &bstate) ? bstate :
|
|
|
04f4ee |
s->level == 0 ? deflate_stored(s, flush) :
|
|
|
04f4ee |
diff --git a/test/crc32_test.c b/test/crc32_test.c
|
|
|
04f4ee |
index 5d73128..2d2a6c7 100644
|
|
|
04f4ee |
|
|
|
04f4ee |
+++ b/test/crc32_test.c
|
|
|
04f4ee |
@@ -11,25 +11,25 @@
|
|
|
04f4ee |
# include <stdlib.h>
|
|
|
04f4ee |
#endif
|
|
|
04f4ee |
|
|
|
04f4ee |
-void test_crc32 OF((uLong crc, Byte* buf, z_size_t len, uLong chk, int line));
|
|
|
04f4ee |
+void test_crc32 OF((uLong crc, char* buf, z_size_t len, uLong chk, int line));
|
|
|
04f4ee |
int main OF((void));
|
|
|
04f4ee |
|
|
|
04f4ee |
typedef struct {
|
|
|
04f4ee |
int line;
|
|
|
04f4ee |
uLong crc;
|
|
|
04f4ee |
- Byte* buf;
|
|
|
04f4ee |
+ char* buf;
|
|
|
04f4ee |
int len;
|
|
|
04f4ee |
uLong expect;
|
|
|
04f4ee |
} crc32_test;
|
|
|
04f4ee |
|
|
|
04f4ee |
void test_crc32(crc, buf, len, chk, line)
|
|
|
04f4ee |
uLong crc;
|
|
|
04f4ee |
- Byte *buf;
|
|
|
04f4ee |
+ char *buf;
|
|
|
04f4ee |
z_size_t len;
|
|
|
04f4ee |
uLong chk;
|
|
|
04f4ee |
int line;
|
|
|
04f4ee |
{
|
|
|
04f4ee |
- uLong res = crc32(crc, buf, len);
|
|
|
04f4ee |
+ uLong res = crc32(crc, (Bytef *) buf, len);
|
|
|
04f4ee |
if (res != chk) {
|
|
|
04f4ee |
fprintf(stderr, "FAIL [%d]: crc32 returned 0x%08X expected 0x%08X\n",
|
|
|
04f4ee |
line, (unsigned int)res, (unsigned int)chk);
|
|
|
04f4ee |
--
|
|
|
04f4ee |
2.19.1
|
|
|
04f4ee |
|