sysdig: implementation fixes

- make sure nparams is initialized
- validate block_total_length in the correct way for sysdig event blocks

(cherry picked from commit cbbe660504)
This commit is contained in:
Loris Degioanni 2021-04-06 14:42:39 -07:00 committed by Guy Harris
parent 180c96beb8
commit 4e7df5af01
1 changed files with 2 additions and 2 deletions

View File

@ -2353,7 +2353,7 @@ pcapng_read_sysdig_event_block(FILE_T fh, pcapng_block_header_t *bh,
guint64 thread_id;
guint32 event_len;
guint16 event_type;
guint32 nparams;
guint32 nparams = 0;
guint min_event_size;
if (bh->block_type == BLOCK_TYPE_SYSDIG_EVENT_V2) {
@ -2362,7 +2362,7 @@ pcapng_read_sysdig_event_block(FILE_T fh, pcapng_block_header_t *bh,
min_event_size = MIN_SYSDIG_EVENT_SIZE;
}
if (bh->block_total_length < MIN_SYSDIG_EVENT_SIZE) {
if (bh->block_total_length < min_event_size) {
*err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup_printf("%s: total block length %u is too small (< %u)", G_STRFUNC,
bh->block_total_length, min_event_size);