Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/m4 Avoid an infinite loop caused by a line accidenta...



details:   https://anonhg.NetBSD.org/src/rev/6f1810855211
branches:  trunk
changeset: 834153:6f1810855211
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Jul 30 22:58:09 2018 +0000

description:
Avoid an infinite loop caused by a line accidentally dropped
in 1.22 (almost 30 months ago!)

[ Discovered by rhialto@ ]

diffstat:

 usr.bin/m4/eval.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 9e3607664ecd -r 6f1810855211 usr.bin/m4/eval.c
--- a/usr.bin/m4/eval.c Mon Jul 30 15:59:44 2018 +0000
+++ b/usr.bin/m4/eval.c Mon Jul 30 22:58:09 2018 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/types.h>
 #include <ctype.h>
@@ -987,6 +987,7 @@
                        }
                } else {
                        while (*src) {
+                               sch = (unsigned char)(*src++);
                                dch = mapvec[sch];
                                while (dch != sch) {
                                        sch = dch;



Home | Main Index | Thread Index | Old Index