Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.2:Rings:0-Bootstrap
flex
0001-Changed-type-of-yy_n_chars-to-int-gh-53-sf...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Changed-type-of-yy_n_chars-to-int-gh-53-sf-160.patch of Package flex
From 7bd230d5d001a3f27f78b95392099fa766bd231a Mon Sep 17 00:00:00 2001 From: Will Estes <westes575@gmail.com> Date: Wed, 24 Feb 2016 20:11:24 -0500 Subject: [PATCH 1/4] Changed type of yy_n_chars to int; gh#53, sf#160. Git-commit: 4a8eccf830e36f6611dc9cc6debd815ff32dcaf5 Patch-mainline: v2.6.1 References: bsc#990856, CVE-2016-6354 The variable yy_n_chars had been of type yy_size_t which is incorrect given its use in read(). While it might be adviseable to look at defining a yy_ssize_t, there might be some issues doing this and so, for now, at least, we'll punt back to int. --- flex.skl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flex.skl b/flex.skl index 01d8204348d2..5c10bcb97a21 100644 --- a/flex.skl +++ b/flex.skl @@ -555,7 +555,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -644,7 +644,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], %not-for-header /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +static int yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ @@ -807,7 +807,7 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - yy_size_t yy_n_chars; + int yy_n_chars; yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; @@ -1724,9 +1724,9 @@ m4_ifdef( [[M4_YY_USES_REJECT]], else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((int) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1); + int new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size M4_YY_CALL_LAST_ARG ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1809,7 +1809,7 @@ m4_ifdef( [[M4_YY_NO_UNPUT]],, if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = YY_G(yy_n_chars) + 2; + register int number_to_move = YY_G(yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = -- 2.6.6
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor