diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2014-07-15 18:04:06 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2014-07-15 18:04:06 +0400 |
commit | 6f50c78e70c41c36e56cac89728650d8a049bbeb (patch) | |
tree | 23b5a19c7eda239eb2dd19191eee01c57d7b2c16 /src/regex.c | |
parent | 60c6e448ebdde76452283c60c2fb0f8b7cfccbe8 (diff) | |
download | emacs-6f50c78e70c41c36e56cac89728650d8a049bbeb.tar.gz |
* regex.c (re_search_2): Use ssize_t to avoid integer overflow.
Diffstat (limited to 'src/regex.c')
-rw-r--r-- | src/regex.c | 3 |
1 files changed, 1 insertions, 2 deletions
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, 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); |