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

SysLogAppender: header elements should be limited in length #579

Closed
mkucmpro opened this issue Mar 7, 2023 · 0 comments
Closed

SysLogAppender: header elements should be limited in length #579

mkucmpro opened this issue Mar 7, 2023 · 0 comments
Assignees
Labels
Milestone

Comments

@mkucmpro
Copy link

mkucmpro commented Mar 7, 2023

According to RFC 5424 the header fields should have length limit:

      HOSTNAME        = NILVALUE / 1*255PRINTUSASCII

      APP-NAME        = NILVALUE / 1*48PRINTUSASCII
      PROCID          = NILVALUE / 1*128PRINTUSASCII
      MSGID           = NILVALUE / 1*32PRINTUSASCII

So, this section of code should probably limit the lengths of the strings passed:

// HOSTNAME
<< LOG4CPLUS_TEXT (' ') << hostname
// APP-NAME
<< LOG4CPLUS_TEXT (' ') << ident
// PROCID
<< LOG4CPLUS_TEXT (' ') << internal::get_process_id ()
// MSGID
<< LOG4CPLUS_TEXT (' ') << event.getLoggerName ()

@wilx wilx self-assigned this Mar 7, 2023
@wilx wilx added the bug label Mar 7, 2023
@wilx wilx added this to the v2.1.1 milestone Mar 7, 2023
wilx added a commit to wilx/log4cplus that referenced this issue Mar 7, 2023
@wilx wilx closed this as completed in 4604a7c Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants