]> git.ipfire.org Git - thirdparty/util-linux.git/commit
logger: generate header when reading message from stdin
authorPatrick Plagwitz <patrick.plagwitz@fau.de>
Mon, 6 Apr 2015 21:50:46 +0000 (22:50 +0100)
committerSami Kerola <sami.kerola@lastminute.com>
Tue, 7 Apr 2015 07:51:05 +0000 (08:51 +0100)
commit4a8919a4e5b28a47cd61fc8b774a6eaee943b90e
treeec6ad87899bcd5e8e2ca87c21b7c0766f1dffdee
parent890e103559ac89b7a0d7a7a71f198e138650ece1
logger: generate header when reading message from stdin

This change fixes crashing error, that ought not to be simply avoided.

$ echo foo | logger -n localhost
Segmentation fault (core dumped)

If the ctl->hdr is just checked not to be NULL syslog message will not
have valid header, so generating such is not optional when reading
message from stdin and writing it to remote destination.

Reviewed-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Patrick Plagwitz <patrick.plagwitz@fau.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/logger.c