mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 00:28:21 +00:00
Merge remote-tracking branch 'origin/topic/jazoff/contentline-limit'
Changed '>' to '>=' in new length check. * origin/topic/jazoff/contentline-limit: add a max_line_length flag to ContentLine_Analyzer
This commit is contained in:
commit
25c6a777a1
10 changed files with 43 additions and 13 deletions
|
@ -7,14 +7,14 @@
|
|||
|
||||
using namespace analyzer::tcp;
|
||||
|
||||
ContentLine_Analyzer::ContentLine_Analyzer(Connection* conn, bool orig)
|
||||
: TCP_SupportAnalyzer("CONTENTLINE", conn, orig)
|
||||
ContentLine_Analyzer::ContentLine_Analyzer(Connection* conn, bool orig, int max_line_length)
|
||||
: TCP_SupportAnalyzer("CONTENTLINE", conn, orig), max_line_length(max_line_length)
|
||||
{
|
||||
InitState();
|
||||
}
|
||||
|
||||
ContentLine_Analyzer::ContentLine_Analyzer(const char* name, Connection* conn, bool orig)
|
||||
: TCP_SupportAnalyzer(name, conn, orig)
|
||||
ContentLine_Analyzer::ContentLine_Analyzer(const char* name, Connection* conn, bool orig, int max_line_length)
|
||||
: TCP_SupportAnalyzer(name, conn, orig), max_line_length(max_line_length)
|
||||
{
|
||||
InitState();
|
||||
}
|
||||
|
@ -229,6 +229,12 @@ int ContentLine_Analyzer::DoDeliverOnce(int len, const u_char* data)
|
|||
return seq_len; \
|
||||
}
|
||||
|
||||
if ( offset >= max_line_length )
|
||||
{
|
||||
Weird("contentline_size_exceeded");
|
||||
EMIT_LINE
|
||||
}
|
||||
|
||||
switch ( c ) {
|
||||
case '\r':
|
||||
// Look ahead for '\n'.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue