Source-Changes-HG archive

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

[src/trunk]: src/sbin/ifconfig Change a > to a >= to avoid writing to the cha...



details:   https://anonhg.NetBSD.org/src/rev/a01ee2d5146c
branches:  trunk
changeset: 755985:a01ee2d5146c
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Thu Jul 01 16:12:23 2010 +0000

description:
Change a > to a >= to avoid writing to the character after the end of
the buffer passed to get_string().

diffstat:

 sbin/ifconfig/util.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 68388a883ded -r a01ee2d5146c sbin/ifconfig/util.c
--- a/sbin/ifconfig/util.c      Thu Jul 01 15:12:31 2010 +0000
+++ b/sbin/ifconfig/util.c      Thu Jul 01 16:12:23 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.13 2009/09/11 22:06:29 dyoung Exp $ */
+/*     $NetBSD: util.c,v 1.14 2010/07/01 16:12:23 dyoung Exp $ */
 
 /*-
  * Copyright (c) 2008 David Young.  All rights reserved.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: util.c,v 1.13 2009/09/11 22:06:29 dyoung Exp $");
+__RCSID("$NetBSD: util.c,v 1.14 2010/07/01 16:12:23 dyoung Exp $");
 #endif /* not lint */
 
 #include <ctype.h>
@@ -103,7 +103,7 @@
                                return NULL;
                        }
                }
-               if (p > buf + len) {
+               if (p >= buf + len) {
                        if (hexstr)
                                warnx("hexadecimal digits too long");
                        else



Home | Main Index | Thread Index | Old Index