journal: do not pass a negative value to memcpy()
The message may contains only whitespaces. Fixes #9795.
This commit is contained in:
parent
cc2ff878fa
commit
57019d5f75
|
@ -333,7 +333,10 @@ void server_process_syslog_message(
|
|||
|
||||
leading_ws = strspn(buf, WHITESPACE);
|
||||
|
||||
if (i == raw_len)
|
||||
if (i == 0)
|
||||
/* The message contains only whitespaces */
|
||||
msg = buf + raw_len;
|
||||
else if (i == raw_len)
|
||||
/* Nice! No need to strip anything on the end, let's optimize this a bit */
|
||||
msg = buf + leading_ws;
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue