summaryrefslogtreecommitdiff
path: root/usr.bin/lex
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2017-05-02 19:16:20 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2017-05-02 19:16:20 +0000
commit3c6d56bce56c581130a47fe5239adabb00c789a0 (patch)
treec9f674972c84f402f5754c0e4f6b1b5e0733abd5 /usr.bin/lex
parent65747fe11732f7dd6746b2012db9054d91c5aede (diff)
Update yy_buf_size after yyrealloc(). The fix has been merged
upstream as well.
Diffstat (limited to 'usr.bin/lex')
-rw-r--r--usr.bin/lex/flex.skl4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/lex/flex.skl b/usr.bin/lex/flex.skl
index bb230208a7a..ca36c8fe3f7 100644
--- a/usr.bin/lex/flex.skl
+++ b/usr.bin/lex/flex.skl
@@ -1,4 +1,4 @@
-/* $OpenBSD: flex.skl,v 1.15 2015/11/22 19:55:22 tedu Exp $ */
+/* $OpenBSD: flex.skl,v 1.16 2017/05/02 19:16:19 millert Exp $ */
%# -*-C-*- vi: set ft=c:
%# This file is processed in several stages.
@@ -1748,6 +1748,8 @@ m4_ifdef( [[M4_YY_USES_REJECT]],
(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size M4_YY_CALL_LAST_ARG );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
YY_G(yy_n_chars) += number_to_move;