]> 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)
committerKarel Zak <kzak@redhat.com>
Wed, 29 Apr 2015 10:30:36 +0000 (12:30 +0200)
commit9daa70d8409b46c5cfd0100400fdd722b9f40bb9
tree8018912fd2f2d187c7db299170cf51672bb52507
parent7116ee246fa9f82350b28a0ac2f4a89b12bd6ce2
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