Fail if *any* of the fields in the per-packet header of the first record

aren't sane, rather than requiring them *all* to have invalid values.

svn path=/trunk/; revision=16610
This commit is contained in:
Guy Harris 2005-11-27 12:10:03 +00:00
parent cf75dd602a
commit 2646996a82
1 changed files with 2 additions and 1 deletions

View File

@ -133,7 +133,8 @@ int hcidump_open(wtap *wth, int *err, gchar **err_info _U_)
return (*err != 0) ? -1 : 0;
}
if (dh.in != 0 && dh.in != 1 && dh.pad != 0 && GUINT16_FROM_LE(dh.len) < 1)
if ((dh.in != 0 && dh.in != 1) || dh.pad != 0
|| GUINT16_FROM_LE(dh.len) < 1)
return 0;
bytes_read = file_read(&type, 1, 1, wth->fh);