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>
This commit is contained in:
parent
df088de18b
commit
7b169cdedd
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue