Squashed commit of the following:
commit
c368a000d0bc4b4844c9b4716675d00dee49bd77
Author: Tom Peters <thopeter@cisco.com>
Date: Fri Mar 30 15:12:07 2018 -0400
http_inspect: bugfix and new alert for gzip underrun
EVENT_206_WITHOUT_RANGE,
EVENT_VERSION_NOT_UPPERCASE,
EVENT_BAD_HEADER_WHITESPACE,
+ EVENT_GZIP_EARLY_END, // 99
EVENT__MAX_VALUE
};
{
// The zipped data stream ended but there is more input data
*infractions += INF_GZIP_EARLY_END;
- events->create_event(EVENT_GZIP_FAILURE);
+ events->create_event(EVENT_GZIP_EARLY_END);
const uInt num_copy =
(compress_stream->avail_in <= compress_stream->avail_out) ?
compress_stream->avail_in : compress_stream->avail_out;
- memcpy(buffer + offset, data, num_copy);
+ memcpy(buffer + offset, data + (length - compress_stream->avail_in), num_copy);
offset += num_copy;
}
else
{ EVENT_206_WITHOUT_RANGE, "206 response sent to a request without a Range header" },
{ EVENT_VERSION_NOT_UPPERCASE, "'HTTP' in version field not all upper case" },
{ EVENT_BAD_HEADER_WHITESPACE, "white space embedded in critical header value" },
+ { EVENT_GZIP_EARLY_END, "gzip compressed data followed by unexpected non-gzip "
+ "data" },
{ 0, nullptr }
};