Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Sami Kerola <kerolasa@iki.fi>
Cc: util-linux@vger.kernel.org, Rainer Gerhards <rgerhards@adiscon.com>
Subject: Re: [PATCH 5/8] logger: fix rfc5424 format crash
Date: Mon, 16 Mar 2015 11:49:54 +0100	[thread overview]
Message-ID: <20150316104954.GE28925@ws.net.home> (raw)
In-Reply-To: <1426424094-25451-6-git-send-email-kerolasa@iki.fi>

On Sun, Mar 15, 2015 at 12:54:51PM +0000, Sami Kerola wrote:
> $ logger --rfc5424=notq message
> Segmentation fault (core dumped)

Not sure if Rainer is subscribed to the list, so please keep him in CC.

> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
> ---
>  misc-utils/logger.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/misc-utils/logger.c b/misc-utils/logger.c
> index 838d225..b007377 100644
> --- a/misc-utils/logger.c
> +++ b/misc-utils/logger.c
> @@ -476,7 +476,8 @@ static void syslog_rfc5424_header(struct logger_ctl *const ctl)
>  #endif
>  			xasprintf(&structured_data,
>  				 "[timeQuality tzKnown=\"1\" isSynced=\"0\"]");
> -	}
> +	} else
> +		structured_data = xstrdup("");

RFC5424:

    STRUCTURED-DATA = NILVALUE / 1*SD-ELEMENT

    NILVALUE        = "-"


... so I guess "" is bad idea. I'll fix it before commit.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2015-03-16 10:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-15 12:54 [PATCH 0/8] pull: logger: add tests and fix couple issues Sami Kerola
2015-03-15 12:54 ` [PATCH 1/8] logger: tidy few indentation issues Sami Kerola
2015-03-16 10:52   ` Karel Zak
2015-03-16 11:22   ` Rainer Gerhards
2015-03-16 11:50     ` Karel Zak
2015-03-15 12:54 ` [PATCH 2/8] logger: check xgethostname() return value Sami Kerola
2015-03-16 10:53   ` Karel Zak
2015-03-15 12:54 ` [PATCH 3/8] tests: add test_logger helper command Sami Kerola
2015-03-16 10:57   ` Karel Zak
2015-03-16 13:19   ` Karel Zak
2015-03-15 12:54 ` [PATCH 4/8] tests: add logger(1) command line options tests Sami Kerola
2015-03-15 12:54 ` [PATCH 5/8] logger: fix rfc5424 format crash Sami Kerola
2015-03-16 10:49   ` Karel Zak [this message]
2015-03-16 10:55     ` Rainer Gerhards
2015-03-16 11:13       ` Karel Zak
2015-03-16 10:57     ` Rainer Gerhards
2015-03-15 12:54 ` [PATCH 6/8] tests: add logger(1) message format tests Sami Kerola
2015-03-15 12:54 ` [PATCH 7/8] logger: use errx() when checking user input Sami Kerola
2015-03-16 10:54   ` Karel Zak
2015-03-15 12:54 ` [PATCH 8/8] tests: add logger(1) error condition tests Sami Kerola
2015-03-16 11:28 ` [PATCH 0/8] pull: logger: add tests and fix couple issues Rainer Gerhards
2015-03-16 12:06   ` Karel Zak
2015-03-16 23:55     ` Sami Kerola
2015-03-17  9:06       ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150316104954.GE28925@ws.net.home \
    --to=kzak@redhat.com \
    --cc=kerolasa@iki.fi \
    --cc=rgerhards@adiscon.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox