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