forked from osmocom/wireshark
BLF: Make sure a struct is completely initialized.
Initialize infstream. Fixes ``` *** CID 1497282: (UNINIT) /builds/wireshark/wireshark/wiretap/blf.c: 506 in blf_pull_logcontainer_into_memory() 500 } 501 502 int ret = inflate(&infstream, Z_NO_FLUSH); 503 /* Z_OK should not happen here since we know how big the buffer should be */ 504 if (Z_STREAM_END != ret) { 505 ws_debug("inflate failed (return code %d) for LogContainer %d", ret, index_log_container); >>> CID 1497282: (UNINIT) >>> Using uninitialized value "infstream.msg". 506 if (infstream.msg != NULL) { 507 ws_debug("inflate returned: \"%s\"", infstream.msg); 508 } 509 return FALSE; 510 } 511 /builds/wireshark/wireshark/wiretap/blf.c: 514 in blf_pull_logcontainer_into_memory() 508 } 509 return FALSE; 510 } 511 512 if (Z_OK != inflateEnd(&infstream)) { 513 ws_debug("inflateEnd failed for LogContainer %d", index_log_container); >>> CID 1497282: (UNINIT) >>> Using uninitialized value "infstream.msg". 514 if (infstream.msg != NULL) { 515 ws_debug("inflateEnd returned: \"%s\"", infstream.msg); 516 } 517 return FALSE; 518 } 519 /builds/wireshark/wireshark/wiretap/blf.c: 496 in blf_pull_logcontainer_into_memory() 490 infstream.avail_out = (unsigned int)tmp.real_length; 491 infstream.next_out = buf; 492 493 /* the actual DE-compression work. */ 494 if (Z_OK != inflateInit(&infstream)) { 495 ws_debug("inflateInit failed for LogContainer %d", index_log_container); >>> CID 1497282: (UNINIT) >>> Using uninitialized value "infstream.msg". 496 if (infstream.msg != NULL) { 497 ws_debug("inflateInit returned: \"%s\"", infstream.msg); 498 } 499 return FALSE; 500 } 501 ```
This commit is contained in:
parent
fad709a582
commit
46cb5d5252
|
@ -480,10 +480,7 @@ blf_pull_logcontainer_into_memory(blf_params_t *params, guint index_log_containe
|
|||
}
|
||||
|
||||
unsigned char *buf = g_try_malloc0((gsize)tmp.real_length);
|
||||
z_stream infstream;
|
||||
infstream.zalloc = Z_NULL;
|
||||
infstream.zfree = Z_NULL;
|
||||
infstream.opaque = Z_NULL;
|
||||
z_stream infstream = {0};
|
||||
|
||||
infstream.avail_in = (unsigned int)data_length;
|
||||
infstream.next_in = compressed_data;
|
||||
|
|
Loading…
Reference in New Issue