Module Name:    src
Committed By:   christos
Date:           Tue Nov 22 21:25:05 UTC 2011

Modified Files:
        src/sys/kern: subr_prf.c

Log Message:
Increment the source buffer when we overflow so that we don't get stuck in
an infinite loop.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/kern/subr_prf.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/kern/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.145 src/sys/kern/subr_prf.c:1.146
--- src/sys/kern/subr_prf.c:1.145	Sun Nov 20 20:44:26 2011
+++ src/sys/kern/subr_prf.c	Tue Nov 22 16:25:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.145 2011/11/21 01:44:26 christos Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.146 2011/11/22 21:25:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.145 2011/11/21 01:44:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.146 2011/11/22 21:25:04 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipkdb.h"
@@ -1144,6 +1144,8 @@ vsnprintf(char *bf, size_t size, const c
 	if (oflags == TOBUFONLY) {					\
 		if ((vp == NULL) || (sbuf < tailp)) 			\
 			*sbuf++ = (C);					\
+		else							\
+			sbuf++;						\
 	} else {							\
 		putchar((C), oflags, vp);				\
 	}								\

Reply via email to