diff options
Diffstat (limited to 'wiretap/packetlogger.c')
-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 */ |