]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
log: Don't crash if log client sends line with pid=0.
authorTimo Sirainen <tss@iki.fi>
Mon, 18 Feb 2013 13:14:05 +0000 (15:14 +0200)
committerTimo Sirainen <tss@iki.fi>
Mon, 18 Feb 2013 13:14:05 +0000 (15:14 +0200)
src/log/log-connection.c

index ee0982c1193c64ce0292e0fb8ee0b29ceb9e5e4a..fde42947f9a6efcd27450a78a6df55d9b3401174 100644 (file)
@@ -201,6 +201,11 @@ log_it(struct log_connection *log, const char *line,
        }
 
        i_failure_parse_line(line, &failure);
+       if (failure.pid == 0) {
+               i_error("Invalid log line: %s", line);
+               return;
+       }
+
        switch (failure.log_type) {
        case LOG_TYPE_FATAL:
        case LOG_TYPE_PANIC: