Merge in SNORT/snort3 from ~BRASTULT/snort3:zip_central_dir to master
Squashed commit of the following:
commit
18fa67b9dee2dc3effc41138788a12824265bdaf
Author: Brandon Stultz <brastult@cisco.com>
Date: Tue Nov 5 16:17:57 2024 -0500
decompress: handle ZIP central directory
// check if we are done with the local_header
if ( parser->Index == parser->Length )
{
+ // read a header, reset the index
+ parser->Index = 0;
+
// check if we read a local_header
if ( parser->local_header != ZIP_LOCAL_HEADER )
- return output_blocked ? File_Decomp_BlockOut : File_Decomp_Complete;
-
- // read a local_header, reset the index
- parser->Index = 0;
+ {
+ parser->State = ZIP_STATE_SEARCH;
+ parser->Length = 0;
+ continue;
+ }
// reset ZIP fields
parser->local_header = 0;
ZIP_STATE_FILENAMELEN, // filename length (2 bytes)
ZIP_STATE_EXTRALEN, // extra field length (2 bytes)
- ZIP_STATE_FILENAME, // filename field (filenamelen bytes)
+ ZIP_STATE_FILENAME, // filename field (filenamelen bytes)
//skipped:
// ZIP_STATE_EXTRA, // extra field (extralen bytes)