diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-11-27 12:10:03 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-11-27 12:10:03 +0000 |
commit | 2646996a825de472f89d394fd2cf3d91483c58c5 (patch) | |
tree | f2aeb8cdb63af36127e114b79f4416b167284fc3 /wiretap/hcidump.c | |
parent | cf75dd602a00eb4d8bf5ddff216fc075ee640385 (diff) |
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
Diffstat (limited to 'wiretap/hcidump.c')
-rw-r--r-- | wiretap/hcidump.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wiretap/hcidump.c b/wiretap/hcidump.c index 7aeadeab70..be699200a1 100644 --- a/wiretap/hcidump.c +++ b/wiretap/hcidump.c @@ -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); |