Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/syslogd PR/50751: David Binderman: check bounds bef...



details:   https://anonhg.NetBSD.org/src/rev/0afc0538f072
branches:  trunk
changeset: 343427:0afc0538f072
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 03 05:34:21 2016 +0000

description:
PR/50751: David Binderman: check bounds before dereferencing.

diffstat:

 usr.sbin/syslogd/tls.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 66a4618fd240 -r 0afc0538f072 usr.sbin/syslogd/tls.c
--- a/usr.sbin/syslogd/tls.c    Wed Feb 03 05:32:14 2016 +0000
+++ b/usr.sbin/syslogd/tls.c    Wed Feb 03 05:34:21 2016 +0000
@@ -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 @@
        }
 
        /* 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++;



Home | Main Index | Thread Index | Old Index