Module Name:    src
Committed By:   christos
Date:           Mon Feb  1 17:38:31 UTC 2016

Modified Files:
        src/sys/arch/ia64/stand/common: dev_net.c

Log Message:
PR/50736: David Binderman: Check bounds before dereferencing.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/stand/common/dev_net.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/ia64/stand/common/dev_net.c
diff -u src/sys/arch/ia64/stand/common/dev_net.c:1.9 src/sys/arch/ia64/stand/common/dev_net.c:1.10
--- src/sys/arch/ia64/stand/common/dev_net.c:1.9	Tue Mar 25 14:35:32 2014
+++ src/sys/arch/ia64/stand/common/dev_net.c	Mon Feb  1 12:38:31 2016
@@ -1,5 +1,5 @@
 /*	
- * $NetBSD: dev_net.c,v 1.9 2014/03/25 18:35:32 christos Exp $
+ * $NetBSD: dev_net.c,v 1.10 2016/02/01 17:38:31 christos Exp $
  */
 
 /*-
@@ -265,7 +265,7 @@ net_getparams(int sock)
      * before passing it along.  This allows us to be compatible with
      * the kernel's diskless (BOOTP_NFSROOT) booting conventions
      */
-    for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++)
+    for (i = 0; i < FNAME_SIZE && rootpath[i] != '\0'; i++)
 	    if (rootpath[i] == ':')
 		    break;
     if (i && i != FNAME_SIZE && rootpath[i] == ':') {

Reply via email to