]> git.armaanb.net Git - opendoas.git/commitdiff
after reading a too long line, restart at the beginning of the buffer so
authortedu <tedu>
Fri, 27 Nov 2015 21:10:17 +0000 (21:10 +0000)
committerDuncan Overbruck <mail@duncano.de>
Thu, 28 Jan 2021 18:56:02 +0000 (19:56 +0100)
we don't keep writing past the end. (the perils of trying to recover from
parse errors.)
noticed by Jan Schreiber

parse.y

diff --git a/parse.y b/parse.y
index 9ddca34e0a6431fef161d4856a8bdb7ebbc8dc94..c50378a5784c0001f2011a12eaa7cc9c101b6e25 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -311,8 +311,10 @@ repeat:
                        }
                }
                *p++ = c;
-               if (p == ebuf)
+               if (p == ebuf) {
                        yyerror("too long line");
+                       p = buf;
+               }
                escape = 0;
        }