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