From 576f33fffd4384d869ae516aa3f346d2ce0b4c6b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 16 May 2019 10:50:03 -0700 Subject: In pcapng_open(), don't use the local pcapng_t once we know it's a pcapng file. Use the local one *only* while we're trying to determine whether we have a pcapng file or not; once we know we have a pcapng file, and have allocated a pcapng_t and attached it to the wtap structure, pass *that* one to pcapng_read_block(), so if it changes anything in the pcapng_t, it changes the one we're using. Change-Id: I53b32595276be97957a0b6056171471878fa40c4 Reviewed-on: https://code.wireshark.org/review/33226 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- wiretap/pcapng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wiretap') diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index e6b7e46f0e..7aa5b6a29b 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -2774,7 +2774,7 @@ pcapng_open(wtap *wth, int *err, gchar **err_info) if (bh.block_type != BLOCK_TYPE_IDB) { break; /* No more IDB:s */ } - if (pcapng_read_block(wth, wth->fh, &pn, &wblock, err, err_info) != PCAPNG_BLOCK_OK) { + if (pcapng_read_block(wth, wth->fh, pcapng, &wblock, err, err_info) != PCAPNG_BLOCK_OK) { wtap_block_free(wblock.block); if (*err == 0) { pcapng_debug("No more IDBs available..."); -- cgit v1.2.3