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/27ce099999e1
branches:  trunk
changeset: 365072:27ce099999e1
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 046d52e7f756 -r 27ce099999e1 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