aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/eqn.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-01-07 20:19:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-01-07 20:19:01 +0000
commitb52337052ba14c502bdac85d23cebf68e8479ce5 (patch)
tree3e6263596a860a4500dd678c0c3c1e65750a7002 /eqn.c
parentee975016524dfb3382109fda2f0b49dd3f2b45f1 (diff)
downloadmandoc-b52337052ba14c502bdac85d23cebf68e8479ce5.tar.gz
mandoc-b52337052ba14c502bdac85d23cebf68e8479ce5.tar.zst
mandoc-b52337052ba14c502bdac85d23cebf68e8479ce5.zip
Recursive "define" was not detected because "lim" was never
incremented, causing infinite loops. Fixing CID 1288962. From christos@ via wiz@, both at NetBSD.
Diffstat (limited to 'eqn.c')
-rw-r--r--eqn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/eqn.c b/eqn.c
index 9359eb8e..bac9a0c7 100644
--- a/eqn.c
+++ b/eqn.c
@@ -1,4 +1,4 @@
-/* $Id: eqn.c,v 1.59 2015/10/06 18:32:19 schwarze Exp $ */
+/* $Id: eqn.c,v 1.60 2016/01/07 20:19:01 schwarze Exp $ */
/*
* Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -448,6 +448,7 @@ again:
memmove(start + *sz + diff, start + *sz,
(strlen(start) - *sz) + 1);
memcpy(start, def->val, def->valsz);
+ lim++;
goto again;
}