Source-Changes-HG archive

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

[src/trunk]: src/sys/dev PR/50749: David Binderman: check bounds before deref...



details:   https://anonhg.NetBSD.org/src/rev/fe8c0eccacb6
branches:  trunk
changeset: 343425:fe8c0eccacb6
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 03 05:29:43 2016 +0000

description:
PR/50749: David Binderman: check bounds before dereference.

diffstat:

 sys/dev/dev_verbose.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 7efe04ddf58a -r fe8c0eccacb6 sys/dev/dev_verbose.c
--- a/sys/dev/dev_verbose.c     Wed Feb 03 05:27:53 2016 +0000
+++ b/sys/dev/dev_verbose.c     Wed Feb 03 05:29:43 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dev_verbose.c,v 1.1 2014/09/21 14:30:22 christos Exp $ */
+/*     $NetBSD: dev_verbose.c,v 1.2 2016/02/03 05:29:43 christos Exp $ */
 
 /*
  * Redistribution and use in source and binary forms, with or without
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dev_verbose.c,v 1.1 2014/09/21 14:30:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dev_verbose.c,v 1.2 2016/02/03 05:29:43 christos Exp $");
 
 #include <sys/param.h>
 
@@ -65,7 +65,7 @@
 
                /* Skip Tokens */
                n++;
-               while (vendors[n] != 0 && n < nvendors)
+               while (n < nvendors && vendors[n] != 0)
                        n++;
        }
        snprintf(buf, len, "vendor %4.4x", vendor);
@@ -86,7 +86,7 @@
 
                /* Skip Tokens */
                n += 2;
-               while (products[n] != 0 && n < nproducts)
+               while (n < nproducts && products[n] != 0)
                        n++;
        }
        snprintf(buf, len, "product %4.4x", product);



Home | Main Index | Thread Index | Old Index