logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Blake Day <bl...@chewy.com>
Subject TlsSyslogFrame calculates message length incorrectly
Date Thu, 21 Jan 2016 00:58:07 GMT
TlsSyslogFrame appears to be miscalculating the message length.  According to RFC5425, the
message length must be the octet count of the SYSLOG-MSG in the frame.  Though the variable
below is aptly named messageLengthInBytes, it is assigned the value from message.length()
(where message is a String) rather than the bytes.

See below for relevant portions of code:

private String message;
private int messageLengthInBytes;

private void setLengthInBytes() {
    messageLengthInBytes = message.length();
}

@Override
public String toString() {
    final String length = Integer.toString(messageLengthInBytes);
    return length + Chars.SPACE + message;
}




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

Mime
View raw message