Improve heuristic for packetlogger file format detection.
svn path=/trunk/; revision=28809
This commit is contained in:
parent
2f2c22c0c0
commit
5562e6e8cf
|
@ -70,10 +70,8 @@ int packetlogger_open(wtap *wth, int *err, gchar **err_info _U_)
|
|||
file_read(&type, 1, 1, wth->fh);
|
||||
|
||||
/* Verify this file belongs to us */
|
||||
if(!((pl_hdr.len & 0xFFFF0000) == 0 && (type < 0x04 ||
|
||||
type == 0xFB ||
|
||||
type == 0xFE ||
|
||||
type == 0xFF)))
|
||||
if (!((8 <= pl_hdr.len) && (pl_hdr.len < 65536) &&
|
||||
(type < 0x04 || type == 0xFB || type == 0xFE || type == 0xFF)))
|
||||
return 0;
|
||||
|
||||
/* No file header. Reset the fh to 0 so we can read the first packet */
|
||||
|
|
Loading…
Reference in New Issue