Tighten heuristics a bit: if the caplen or iplen is 0 then it's not a valid CSIDS file

svn path=/trunk/; revision=25680
This commit is contained in:
Jeff Morriss 2008-07-08 22:24:32 +00:00
parent be97290991
commit a3e69d9ec5
1 changed files with 5 additions and 1 deletions

View File

@ -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 */