diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-11-15 09:52:02 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-11-15 17:52:40 +0000 |
commit | c82c60136d33a704ee0c360979cc57b44ac86957 (patch) | |
tree | 67a498923133c4b236d6ce36b36feb55ef42a745 /wiretap/peekclassic.c | |
parent | 6c66a639d0dcbb4a0ce3d7334410e9a907d73944 (diff) |
Don't set anything in *wth until we've decided it's a Peek classic file.
Change-Id: I8b6f5b46cc578a65eec3e255d468d3841f9b0197
Reviewed-on: https://code.wireshark.org/review/30652
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/peekclassic.c')
-rw-r--r-- | wiretap/peekclassic.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/wiretap/peekclassic.c b/wiretap/peekclassic.c index 7bc2dd0bb9..374d96bc76 100644 --- a/wiretap/peekclassic.c +++ b/wiretap/peekclassic.c @@ -153,6 +153,7 @@ wtap_open_return_val peekclassic_open(wtap *wth, int *err, gchar **err_info) { peekclassic_header_t ep_hdr; time_t reference_time; + int file_encap; peekclassic_t *peekclassic; /* Peek classic files do not start with a magic value large enough @@ -231,11 +232,11 @@ wtap_open_return_val peekclassic_open(wtap *wth, int *err, gchar **err_info) switch (ep_hdr.secondary.v567.mediaType) { case 0: - wth->file_encap = WTAP_ENCAP_ETHERNET; + file_encap = WTAP_ENCAP_ETHERNET; break; case 1: - wth->file_encap = WTAP_ENCAP_TOKEN_RING; + file_encap = WTAP_ENCAP_TOKEN_RING; break; default: @@ -255,7 +256,7 @@ wtap_open_return_val peekclassic_open(wtap *wth, int *err, gchar **err_info) * some radio information. Presumably * this is from AiroPeek. */ - wth->file_encap = WTAP_ENCAP_IEEE_802_11_WITH_RADIO; + file_encap = WTAP_ENCAP_IEEE_802_11_WITH_RADIO; break; default: @@ -316,6 +317,7 @@ wtap_open_return_val peekclassic_open(wtap *wth, int *err, gchar **err_info) peekclassic = (peekclassic_t *)g_malloc(sizeof(peekclassic_t)); wth->priv = (void *)peekclassic; peekclassic->reference_time = reference_time; + wth->file_encap = file_encap; switch (ep_hdr.master.version) { case 5: |