]> err.no Git - systemd/commitdiff
journald: fix length of "SYSLOG_IDENTIFIER="
authorMichal Schmidt <mschmidt@redhat.com>
Mon, 21 May 2012 17:31:41 +0000 (19:31 +0200)
committerMichal Schmidt <mschmidt@redhat.com>
Mon, 21 May 2012 18:03:26 +0000 (20:03 +0200)
Fixes weird messages like:
May 20 22:23:30 jik2 TIFIER=systemd-logind[795]: New session 46 of user gdm.

https://bugzilla.redhat.com/show_bug.cgi?id=823498

src/journal/journald.c

index a6f27f6ef4cc86c765adfddc4a9b844db754c5ba..1093f3c9c8cd39dbbb00705ca77a4db4883b9853 100644 (file)
@@ -1235,10 +1235,10 @@ static void process_native_message(
                                         priority = (priority & LOG_PRIMASK) | (((p[16] - '0')*10 + (p[17] - '0')) << 3);
 
                                 else if (l >= 12 &&
-                                         memcmp(p, "SYSLOG_IDENTIFIER=", 11) == 0) {
+                                         memcmp(p, "SYSLOG_IDENTIFIER=", 18) == 0) {
                                         char *t;
 
-                                        t = strndup(p + 11, l - 11);
+                                        t = strndup(p + 18, l - 18);
                                         if (t) {
                                                 free(identifier);
                                                 identifier = t;