aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2008-07-08 22:24:32 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2008-07-08 22:24:32 +0000
commita3e69d9ec5fc35ce230053a0f0180f108b239d07 (patch)
tree0aa611ec2b892082105838989ed91420fa6bb694 /wiretap
parentbe97290991e5bcb175bd4a3a67e70cbd22a3f85f (diff)
Tighten heuristics a bit: if the caplen or iplen is 0 then it's not a valid CSIDS file
svn path=/trunk/; revision=25680
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/csids.c6
1 files changed, 5 insertions, 1 deletions
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 */