diff options
author | Michael Tüxen <tuexen@fh-muenster.de> | 2009-06-22 12:13:12 +0000 |
---|---|---|
committer | Michael Tüxen <tuexen@fh-muenster.de> | 2009-06-22 12:13:12 +0000 |
commit | 5562e6e8cf857edddc9f7682db5af06bcc5a1389 (patch) | |
tree | d26914c09de7e23127c37d797bd40a19b5b4a1a6 /wiretap | |
parent | 2f2c22c0c013d637d35c0a802004a45affad8167 (diff) |
Improve heuristic for packetlogger file format detection.
svn path=/trunk/; revision=28809
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/packetlogger.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/wiretap/packetlogger.c b/wiretap/packetlogger.c index 20b175a89a..6907009198 100644 --- a/wiretap/packetlogger.c +++ b/wiretap/packetlogger.c @@ -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 */ |