aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2014-07-15 18:04:06 +0400
committerDmitry Antipov2014-07-15 18:04:06 +0400
commit6f50c78e70c41c36e56cac89728650d8a049bbeb (patch)
tree23b5a19c7eda239eb2dd19191eee01c57d7b2c16 /src
parent60c6e448ebdde76452283c60c2fb0f8b7cfccbe8 (diff)
downloademacs-6f50c78e70c41c36e56cac89728650d8a049bbeb.tar.gz
emacs-6f50c78e70c41c36e56cac89728650d8a049bbeb.zip
* regex.c (re_search_2): Use ssize_t to avoid integer overflow.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog2
-rw-r--r--src/regex.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a640b970b67..87dd0eacc04 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -6,6 +6,8 @@
6 Use record_unwind_protect_int and avoid consing. 6 Use record_unwind_protect_int and avoid consing.
7 (syms_of_xmenu) [USE_X_TOOLKIT]: Declare WIDGET_ID_TICK_START. 7 (syms_of_xmenu) [USE_X_TOOLKIT]: Declare WIDGET_ID_TICK_START.
8 8
9 * regex.c (re_search_2): Use ssize_t to avoid integer overflow.
10
92014-07-14 Paul Eggert <eggert@cs.ucla.edu> 112014-07-14 Paul Eggert <eggert@cs.ucla.edu>
10 12
11 Use binary-io module, O_BINARY, and "b" flag (Bug#18006). 13 Use binary-io module, O_BINARY, and "b" flag (Bug#18006).
diff --git a/src/regex.c b/src/regex.c
index ac71b797fbd..1c1164da57d 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -4342,8 +4342,7 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, size_t size1,
4342 4342
4343 if (range > 0) /* Searching forwards. */ 4343 if (range > 0) /* Searching forwards. */
4344 { 4344 {
4345 register int lim = 0; 4345 ssize_t irange = range, lim = 0;
4346 ssize_t irange = range;
4347 4346
4348 if (startpos < size1 && startpos + range >= size1) 4347 if (startpos < size1 && startpos + range >= size1)
4349 lim = range - (size1 - startpos); 4348 lim = range - (size1 - startpos);