diff options
author | Nathan Moinvaziri <nathan@nathanm.com> | 2020-06-28 13:32:00 -0700 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2020-06-29 17:55:51 +0200 |
commit | 9abe04b926ef688efa3d4f464209246a22afb01d (patch) | |
tree | a8ba6e8b0f6874fbfee65d85cf70a1c90c2d419b /test/example.c | |
parent | 551254a4c175fbebfabffaa9a4684ab528f10c89 (diff) |
Fixed wrong size being used in calloc in test_deflate_set_header.
CID 293478 (#1 of 1): Wrong size argument (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument 1UL to function calloc that returns a pointer of type zng_gz_header * is suspicious because a multiple of sizeof (zng_gz_header) /*80*/ is expected.
Diffstat (limited to 'test/example.c')
-rw-r--r-- | test/example.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/example.c b/test/example.c index a47155f..93ecda7 100644 --- a/test/example.c +++ b/test/example.c @@ -855,7 +855,7 @@ void test_deflate_prime(unsigned char *compr, size_t comprLen) { * Test deflateSetHeader() with small buffers */ void test_deflate_set_header(unsigned char *compr, size_t comprLen) { - PREFIX(gz_header) *head = calloc(256, 1); + PREFIX(gz_header) *head = calloc(1, sizeof(PREFIX(gz_header))); PREFIX3(stream) c_stream; /* compression stream */ int err; size_t len = strlen(hello)+1; |