svn commit: r288925 - stable/9/usr.sbin/ndiscvt
Dmitry Marakasov
amdmi3 at FreeBSD.org
Tue Oct 6 15:30:49 UTC 2015
Author: amdmi3 (ports committer)
Date: Tue Oct 6 15:30:48 2015
New Revision: 288925
URL: https://svnweb.freebsd.org/changeset/base/288925
Log:
MFC r288120: Fix crash on parsing some inf files
Modified:
stable/9/usr.sbin/ndiscvt/inf.c
stable/9/usr.sbin/ndiscvt/inf.h
Directory Properties:
stable/9/usr.sbin/ndiscvt/ (props changed)
Modified: stable/9/usr.sbin/ndiscvt/inf.c
==============================================================================
--- stable/9/usr.sbin/ndiscvt/inf.c Tue Oct 6 15:30:41 2015 (r288924)
+++ stable/9/usr.sbin/ndiscvt/inf.c Tue Oct 6 15:30:48 2015 (r288925)
@@ -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/9/usr.sbin/ndiscvt/inf.h
==============================================================================
--- stable/9/usr.sbin/ndiscvt/inf.h Tue Oct 6 15:30:41 2015 (r288924)
+++ stable/9/usr.sbin/ndiscvt/inf.h Tue Oct 6 15:30:48 2015 (r288925)
@@ -4,7 +4,7 @@
* $FreeBSD$
*/
-#define W_MAX 16
+#define W_MAX 32
struct section {
const char * name;
More information about the svn-src-stable-9
mailing list