svn commit: r261901 - head/sys/kern

Sergey Kandaurov pluknet at FreeBSD.org
Fri Feb 14 20:54:04 UTC 2014


Author: pluknet
Date: Fri Feb 14 20:54:03 2014
New Revision: 261901
URL: http://svnweb.freebsd.org/changeset/base/261901

Log:
  Preserve one character space for a trailing '\0'.
  
  Found by:	Ivan Klymenko via cppcheck
  Discussed with: ae
  MFC after:	1 week

Modified:
  head/sys/kern/subr_hints.c

Modified: head/sys/kern/subr_hints.c
==============================================================================
--- head/sys/kern/subr_hints.c	Fri Feb 14 20:34:24 2014	(r261900)
+++ head/sys/kern/subr_hints.c	Fri Feb 14 20:54:03 2014	(r261901)
@@ -210,7 +210,7 @@ res_find(int *line, int *startln,
 		if (strncmp(cp, "hint.", 5) != 0)
 			hit = 0;
 		else
-			n = sscanf(cp, "hint.%32[^.].%d.%32[^=]=%128s",
+			n = sscanf(cp, "hint.%32[^.].%d.%32[^=]=%127s",
 			    r_name, &r_unit, r_resname, r_value);
 		if (hit && n != 4) {
 			printf("CONFIG: invalid hint '%s'\n", cp);


More information about the svn-src-head mailing list