From a3e69d9ec5fc35ce230053a0f0180f108b239d07 Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Tue, 8 Jul 2008 22:24:32 +0000 Subject: Tighten heuristics a bit: if the caplen or iplen is 0 then it's not a valid CSIDS file svn path=/trunk/; revision=25680 --- wiretap/csids.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'wiretap') diff --git a/wiretap/csids.c b/wiretap/csids.c index 1e0f862aa9..973fcedf28 100644 --- a/wiretap/csids.c +++ b/wiretap/csids.c @@ -84,7 +84,7 @@ int csids_open(wtap *wth, int *err, gchar **err_info _U_) return 0; } } - if( hdr.zeropad != 0 ) { + if( hdr.zeropad != 0 || hdr.caplen == 0 ) { return 0; } hdr.seconds = pntohl( &hdr.seconds ); @@ -108,6 +108,10 @@ int csids_open(wtap *wth, int *err, gchar **err_info _U_) } } iplen = pntohs(&iplen); + + if ( iplen == 0 ) + return(0); + /* if iplen and hdr.caplen are equal, default to no byteswap. */ if( iplen > hdr.caplen ) { /* maybe this is just a byteswapped version. the iplen ipflags */ -- cgit v1.2.3