emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r117870: Prefer ptrdiff_t to int and avoid integer o


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r117870: Prefer ptrdiff_t to int and avoid integer overflows.
Date: Sat, 13 Sep 2014 04:42:20 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117870
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Sat 2014-09-13 08:41:54 +0400
message:
  Prefer ptrdiff_t to int and avoid integer overflows.
  * fileio.c (make_temp_name):
  * font.c (font_parse_family_registry): Avoid integer
  overflow on string size calculation.
  * data.c (Faset): Likewise for byte index.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/data.c                     data.c-20091113204419-o5vbwnq5f7feedwu-251
  src/fileio.c                   fileio.c-20091113204419-o5vbwnq5f7feedwu-210
  src/font.c                     font.c-20091113204419-o5vbwnq5f7feedwu-8540
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-09-12 11:12:40 +0000
+++ b/src/ChangeLog     2014-09-13 04:41:54 +0000
@@ -1,3 +1,11 @@
+2014-09-13  Dmitry Antipov  <address@hidden>
+
+       Prefer ptrdiff_t to int and avoid integer overflows.
+       * fileio.c (make_temp_name):
+       * font.c (font_parse_family_registry): Avoid integer
+       overflow on string size calculation.
+       * data.c (Faset): Likewise for byte index.
+
 2014-09-12  Detlev Zundel  <address@hidden>
 
        * buffer.c (syms_of_buffer): DEFSYM Qchoice (Bug#18337).
@@ -15,7 +23,7 @@
        * lread.c (readevalloop_eager_expand_eval): Add GCPRO and fix
        bootstrap broken if GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
 
-       Remove redundant GCPROs around Ffuncall and Fapply calls. This
+       Remove redundant GCPROs around Ffuncall and Fapply calls.  This
        is safe because Ffuncall protects all of its arguments by itself.
        * charset.c (map_charset_for_dump): Remove redundant GCPRO.
        * eval.c (Fapply, apply1, call0, call1, call2, call3, call4, call5)

=== modified file 'src/data.c'
--- a/src/data.c        2014-09-08 06:00:58 +0000
+++ b/src/data.c        2014-09-13 04:41:54 +0000
@@ -2310,7 +2310,7 @@
        {
          if (! SINGLE_BYTE_CHAR_P (c))
            {
-             int i;
+             ptrdiff_t i;
 
              for (i = SBYTES (array) - 1; i >= 0; i--)
                if (SREF (array, i) >= 0x80)

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2014-09-07 07:04:01 +0000
+++ b/src/fileio.c      2014-09-13 04:41:54 +0000
@@ -728,7 +728,7 @@
 make_temp_name (Lisp_Object prefix, bool base64_p)
 {
   Lisp_Object val, encoded_prefix;
-  int len;
+  ptrdiff_t len;
   printmax_t pid;
   char *p, *data;
   char pidbuf[INT_BUFSIZE_BOUND (printmax_t)];

=== modified file 'src/font.c'
--- a/src/font.c        2014-09-07 17:04:19 +0000
+++ b/src/font.c        2014-09-13 04:41:54 +0000
@@ -1761,7 +1761,7 @@
 void
 font_parse_family_registry (Lisp_Object family, Lisp_Object registry, 
Lisp_Object font_spec)
 {
-  int len;
+  ptrdiff_t len;
   char *p0, *p1;
 
   if (! NILP (family)


reply via email to

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