diff options
| author | christos <christos@NetBSD.org> | 2016-02-03 05:34:21 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2016-02-03 05:34:21 +0000 |
| commit | c2c74292775e4898aaa8ed82d6c13ce8c190c71e (patch) | |
| tree | 02c1a3f90c0b38dfaaa7e65a47969de130f9b3f7 /usr.sbin/syslogd | |
| parent | 6b088bc8a1266f199cd67a84f86bb8d145ae154b (diff) | |
PR/50751: David Binderman: check bounds before dereferencing.
Diffstat (limited to 'usr.sbin/syslogd')
| -rw-r--r-- | usr.sbin/syslogd/tls.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/syslogd/tls.c b/usr.sbin/syslogd/tls.c index 243ef2581e6..46d1ad4e1ae 100644 --- a/usr.sbin/syslogd/tls.c +++ b/usr.sbin/syslogd/tls.c @@ -1,4 +1,4 @@ -/* $NetBSD: tls.c,v 1.11 2013/05/27 23:15:51 christos Exp $ */ +/* $NetBSD: tls.c,v 1.12 2016/02/03 05:34:21 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: tls.c,v 1.11 2013/05/27 23:15:51 christos Exp $"); +__RCSID("$NetBSD: tls.c,v 1.12 2016/02/03 05:34:21 christos Exp $"); #ifndef DISABLE_TLS #include "syslogd.h" @@ -1590,8 +1590,8 @@ tls_split_messages(struct TLS_Incoming_Conn *c) } /* read length prefix, always at start of buffer */ - while (isdigit((unsigned char)c->inbuf[offset]) - && offset < c->read_pos) { + while (offset < c->read_pos && isdigit((unsigned char)c->inbuf[offset])) + { msglen *= 10; msglen += c->inbuf[offset] - '0'; offset++; |
