summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2016-01-07 20:18:34 +0000
committerschwarze <schwarze@openbsd.org>2016-01-07 20:18:34 +0000
commita918c4265255ed7e3f33ec0078ad15a72d42ae02 (patch)
treed7187257cfe82f54096491f38d361e3ee902755d
parentslightly shorter Nd; ok mikeb (diff)
downloadwireguard-openbsd-a918c4265255ed7e3f33ec0078ad15a72d42ae02.tar.xz
wireguard-openbsd-a918c4265255ed7e3f33ec0078ad15a72d42ae02.zip
Recursive "define" was not detected because "lim" was never
incremented, causing infinite loops. Fixing CID 1288962. From christos@ via wiz@, both at NetBSD.
-rw-r--r--usr.bin/mandoc/eqn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/mandoc/eqn.c b/usr.bin/mandoc/eqn.c
index fc521c890a6..c9decf5fec2 100644
--- a/usr.bin/mandoc/eqn.c
+++ b/usr.bin/mandoc/eqn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eqn.c,v 1.22 2015/10/06 18:30:43 schwarze Exp $ */
+/* $OpenBSD: eqn.c,v 1.23 2016/01/07 20:18:34 schwarze Exp $ */
/*
* Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -446,6 +446,7 @@ again:
memmove(start + *sz + diff, start + *sz,
(strlen(start) - *sz) + 1);
memcpy(start, def->val, def->valsz);
+ lim++;
goto again;
}