From 9f2b1d9e7626418f6623dc75c0cc80b471e9c975 Mon Sep 17 00:00:00 2001 From: kre Date: Mon, 30 Jul 2018 22:58:09 +0000 Subject: [PATCH] Avoid an infinite loop caused by a line accidentally dropped in 1.22 (almost 30 months ago!) [ Discovered by rhialto@ ] --- usr.bin/m4/eval.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c index 0f16983a9ef8..94150b1baa9f 100644 --- a/usr.bin/m4/eval.c +++ b/usr.bin/m4/eval.c @@ -1,5 +1,5 @@ /* $OpenBSD: eval.c,v 1.66 2008/08/21 21:01:47 espie Exp $ */ -/* $NetBSD: eval.c,v 1.26 2017/10/23 02:38:46 christos Exp $ */ +/* $NetBSD: eval.c,v 1.27 2018/07/30 22:58:09 kre Exp $ */ /* * Copyright (c) 1989, 1993 @@ -42,7 +42,7 @@ #include "nbtool_config.h" #endif #include -__RCSID("$NetBSD: eval.c,v 1.26 2017/10/23 02:38:46 christos Exp $"); +__RCSID("$NetBSD: eval.c,v 1.27 2018/07/30 22:58:09 kre Exp $"); #include #include @@ -987,6 +987,7 @@ map(char *dest, const char *src, const char *from, const char *to) } } else { while (*src) { + sch = (unsigned char)(*src++); dch = mapvec[sch]; while (dch != sch) { sch = dch;