emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117536: * regex.c (re_search_2): Use ssize_t to avo


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r117536: * regex.c (re_search_2): Use ssize_t to avoid integer overflow.
Date: Tue, 15 Jul 2014 14:04:49 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117536
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2014-07-15 18:04:06 +0400
message:
  * regex.c (re_search_2): Use ssize_t to avoid integer overflow.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/regex.c                    regex.c-20091113204419-o5vbwnq5f7feedwu-518
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-07-15 09:59:05 +0000
+++ b/src/ChangeLog     2014-07-15 14:04:06 +0000
@@ -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  <address@hidden>
 
        Use binary-io module, O_BINARY, and "b" flag (Bug#18006).

=== modified file 'src/regex.c'
--- a/src/regex.c       2014-05-17 08:11:31 +0000
+++ b/src/regex.c       2014-07-15 14:04:06 +0000
@@ -4342,8 +4342,7 @@
 
          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);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]