* regex.c (re_search_2): Use ssize_t to avoid integer overflow.
This commit is contained in:
parent
60c6e448eb
commit
6f50c78e70
2 changed files with 3 additions and 2 deletions
|
@ -6,6 +6,8 @@
|
|||
Use record_unwind_protect_int and avoid consing.
|
||||
(syms_of_xmenu) [USE_X_TOOLKIT]: Declare WIDGET_ID_TICK_START.
|
||||
|
||||
* regex.c (re_search_2): Use ssize_t to avoid integer overflow.
|
||||
|
||||
2014-07-14 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Use binary-io module, O_BINARY, and "b" flag (Bug#18006).
|
||||
|
|
|
@ -4342,8 +4342,7 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, size_t size1,
|
|||
|
||||
if (range > 0) /* Searching forwards. */
|
||||
{
|
||||
register int lim = 0;
|
||||
ssize_t irange = range;
|
||||
ssize_t irange = range, lim = 0;
|
||||
|
||||
if (startpos < size1 && startpos + range >= size1)
|
||||
lim = range - (size1 - startpos);
|
||||
|
|
Loading…
Add table
Reference in a new issue