Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util/debug: increase max length of message #12183

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/util-debug.h
Original file line number Diff line number Diff line change
@@ -80,8 +80,8 @@ typedef enum {
#define SC_LOG_DEF_LOG_FORMAT_REL_CONFIG "[%i] %d: %S: %M"
#define SC_LOG_DEF_LOG_FORMAT_DEBUG "%d: %S: %M [%n:%f:%l]"

/* The maximum length of the log message */
#define SC_LOG_MAX_LOG_MSG_LEN 2048
/* The maximum length of the log message: we add max rule size and other info */
#define SC_LOG_MAX_LOG_MSG_LEN 8192 + 256
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does the 256 come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a guess but I've been overly optimistic because if we look at the failure message for a signature, we have in fact inside of the log message error parsing signature {{SIG}} from file {{FILE}}. It we take the full log wihtout the SIG and FILE, we have 265 chars (512 for a round count).
So it we want to be strict we need in fact

#define SC_LOG_MAX_LOG_MSG_LEN 8192 + PATH_MAX + 512

PATH_MAX is usually 4092.

Should I switch to that ?


/* The maximum length of the log format */
#define SC_LOG_MAX_LOG_FORMAT_LEN 128