diff options
-rw-r--r-- | sysklogd/syslogd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index e1e71378c..3c18c507f 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -411,14 +411,16 @@ static int serveConnection (int conn) | |||
411 | int pri = (LOG_USER | LOG_NOTICE); | 411 | int pri = (LOG_USER | LOG_NOTICE); |
412 | char line[ BUFSIZE + 1 ]; | 412 | char line[ BUFSIZE + 1 ]; |
413 | unsigned char c; | 413 | unsigned char c; |
414 | int gotpri = 0; | ||
414 | 415 | ||
415 | char *q = line; | 416 | char *q = line; |
416 | 417 | ||
417 | tmpbuf[ n_read - 1 ] = '\0'; | 418 | tmpbuf[ n_read - 1 ] = '\0'; |
418 | 419 | ||
419 | while (p && (c = *p) && q < &line[ sizeof (line) - 1 ]) { | 420 | while (p && (c = *p) && q < &line[ sizeof (line) - 1 ]) { |
420 | if (c == '<') { | 421 | if ((c == '<') && !gotpri && isdigit(p[1])) { |
421 | /* Parse the magic priority number. */ | 422 | /* Parse the magic priority number. */ |
423 | gotpri = 1; | ||
422 | pri = 0; | 424 | pri = 0; |
423 | while (isdigit (*(++p))) { | 425 | while (isdigit (*(++p))) { |
424 | pri = 10 * pri + (*p - '0'); | 426 | pri = 10 * pri + (*p - '0'); |