From af9b9a58897bd4d744ef997d27aabae468075ee6 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 7 Jan 2016 20:18:35 +0000 Subject: Recursive "define" was not detected because "lim" was never incremented, causing infinite loops. Fixing CID 1288962. From christos@ via wiz@, both at NetBSD. --- usr.bin/mandoc/eqn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 * Copyright (c) 2014, 2015 Ingo Schwarze @@ -446,6 +446,7 @@ again: memmove(start + *sz + diff, start + *sz, (strlen(start) - *sz) + 1); memcpy(start, def->val, def->valsz); + lim++; goto again; } -- cgit v1.2.3