Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Oct 2015 15:30:42 +0000 (UTC)
From:      Dmitry Marakasov <amdmi3@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r288924 - stable/10/usr.sbin/ndiscvt
Message-ID:  <201510061530.t96FUgQL024488@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: amdmi3 (ports committer)
Date: Tue Oct  6 15:30:41 2015
New Revision: 288924
URL: https://svnweb.freebsd.org/changeset/base/288924

Log:
  MFC r288120: Fix crash on parsing some inf files

Modified:
  stable/10/usr.sbin/ndiscvt/inf.c
  stable/10/usr.sbin/ndiscvt/inf.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/ndiscvt/inf.c
==============================================================================
--- stable/10/usr.sbin/ndiscvt/inf.c	Tue Oct  6 14:56:37 2015	(r288923)
+++ stable/10/usr.sbin/ndiscvt/inf.c	Tue Oct  6 15:30:41 2015	(r288924)
@@ -887,6 +887,12 @@ regkey_add (const char *r)
 void
 push_word (const char *w)
 {
+
+	if (idx == W_MAX) {
+		fprintf(stderr, "too many words; try bumping W_MAX in inf.h\n");
+		exit(1);
+	}
+
 	if (w && strlen(w))
 		words[idx++] = w;
 	else

Modified: stable/10/usr.sbin/ndiscvt/inf.h
==============================================================================
--- stable/10/usr.sbin/ndiscvt/inf.h	Tue Oct  6 14:56:37 2015	(r288923)
+++ stable/10/usr.sbin/ndiscvt/inf.h	Tue Oct  6 15:30:41 2015	(r288924)
@@ -4,7 +4,7 @@
  * $FreeBSD$
  */
 
-#define W_MAX	16
+#define W_MAX	32
 
 struct section {
 	const char *	name;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510061530.t96FUgQL024488>