diff options
Diffstat (limited to 'src/journal/journald-syslog.c')
-rw-r--r-- | src/journal/journald-syslog.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c index 9dea116722..97711ac7a3 100644 --- a/src/journal/journald-syslog.c +++ b/src/journal/journald-syslog.c @@ -194,7 +194,7 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid) e = l; l--; - if (p[l-1] == ']') { + if (l > 0 && p[l-1] == ']') { size_t k = l-1; for (;;) { @@ -219,8 +219,8 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid) if (t) *identifier = t; - if (strchr(WHITESPACE, p[e])) - e++; + e += strspn(p + e, WHITESPACE); + *buf = p + e; return e; } |