[systemd-devel] [PATCH] logs-show: fix corrupt output with empty messages

Uoti Urpala uoti.urpala at pp1.inet.fi
Wed Feb 19 17:00:09 PST 2014


I also noticed a minor C correctness problem in print_multiline(): if
the last line of message has no newline, then end = message+message_len.
The next loop iteration calculates "pos = end + 1". This means that pos
points 2 past the last byte, which is not guaranteed to be a valid
address calculation for general C objects (could theoretically wrap
around to start of address space etc). Probably won't be called with
such objects in practice.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-logs-show-fix-corrupt-output-with-empty-messages.patch
Type: text/x-patch
Size: 1498 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140220/852a6730/attachment.bin>

More information about the systemd-devel mailing list