Skip to content

Commit

Permalink
Fixed wrong size being used in calloc in test_deflate_set_header.
Browse files Browse the repository at this point in the history
    CID 293478 (madler#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.
  • Loading branch information
nmoinvaz authored and Dead2 committed Jun 29, 2020
1 parent 551254a commit 9abe04b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9abe04b

Please sign in to comment.