aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-02-04 14:53:58 -0800
committerGuy Harris <guy@alum.mit.edu>2018-02-04 22:54:42 +0000
commit7b169cdedd93d5bc072e6582dde6430457ece505 (patch)
tree49d5a69b885907465be80b18617239fb12f7d8b8
parentdf088de18b9a2375f6797ac4c62a6d29aa49d00f (diff)
Don't treat short reads as errors when checking the file type.
A short read isn't a clear error when you don't have a magic number and are doing "does this look somewhat like a file of this type" test, it's probably an indication that it's *not* a file of that type. Change-Id: Iab2f32e7d169a777c50a36958eeb4e82a3809227 Reviewed-on: https://code.wireshark.org/review/25602 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--wiretap/vwr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/wiretap/vwr.c b/wiretap/vwr.c
index 840d3e5092..8687541cd7 100644
--- a/wiretap/vwr.c
+++ b/wiretap/vwr.c
@@ -998,6 +998,8 @@ static int vwr_get_fpga_version(wtap *wth, int *err, gchar **err_info)
else if (v_type != VT_FRAME) {
if (!wtap_read_bytes(wth->fh, NULL, f_len, err, err_info)) {
g_free(rec);
+ if (*err == WTAP_ERR_SHORT_READ)
+ return UNKNOWN_FPGA; /* short read - not a vwr file */
return -1;
}
else if (v_type == VT_CPMSG)