emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src ChangeLog ftfont.c [EMACS_23_1_RC]


From: Chong Yidong
Subject: [Emacs-diffs] emacs/src ChangeLog ftfont.c [EMACS_23_1_RC]
Date: Tue, 23 Jun 2009 14:14:43 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_23_1_RC
Changes by:     Chong Yidong <cyd>      09/06/23 14:14:42

Modified files:
        src            : ChangeLog ftfont.c 

Log message:
        * src/ftfont.c (setup_otf_gstring, ftfont_shape_by_flt): Use
        xmalloc and xrealloc (not malloc and realloc), so subsequent heap
        pointer dereferences are guaranteed to be valid.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&only_with_tag=EMACS_23_1_RC&r1=1.7586&r2=1.7586.2.1
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ftfont.c?cvsroot=emacs&only_with_tag=EMACS_23_1_RC&r1=1.54&r2=1.54.2.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7586
retrieving revision 1.7586.2.1
diff -u -b -r1.7586 -r1.7586.2.1
--- ChangeLog   21 Jun 2009 03:34:19 -0000      1.7586
+++ ChangeLog   23 Jun 2009 14:14:40 -0000      1.7586.2.1
@@ -1,3 +1,9 @@
+2009-06-23  Jim Meyering  <address@hidden>
+
+       * src/ftfont.c (setup_otf_gstring, ftfont_shape_by_flt): Use
+       xmalloc and xrealloc (not malloc and realloc), so subsequent heap
+       pointer dereferences are guaranteed to be valid.
+
 2009-06-21  Jason Rumney  <address@hidden>
 
        * w32term.c (keyboard_codepage): New static variable.

Index: ftfont.c
===================================================================
RCS file: /sources/emacs/emacs/src/ftfont.c,v
retrieving revision 1.54
retrieving revision 1.54.2.1
diff -u -b -r1.54 -r1.54.2.1
--- ftfont.c    17 Apr 2009 18:38:02 -0000      1.54
+++ ftfont.c    23 Jun 2009 14:14:42 -0000      1.54.2.1
@@ -1700,12 +1700,12 @@
 {
   if (otf_gstring.size == 0)
     {
-      otf_gstring.glyphs = (OTF_Glyph *) malloc (sizeof (OTF_Glyph) * size);
+      otf_gstring.glyphs = (OTF_Glyph *) xmalloc (sizeof (OTF_Glyph) * size);
       otf_gstring.size = size;
     }
   else if (otf_gstring.size < size)
     {
-      otf_gstring.glyphs = (OTF_Glyph *) realloc (otf_gstring.glyphs,
+      otf_gstring.glyphs = (OTF_Glyph *) xrealloc (otf_gstring.glyphs,
                                                  sizeof (OTF_Glyph) * size);
       otf_gstring.size = size;
     }
@@ -2037,12 +2037,12 @@
     {
       gstring.allocated = len * 2;
       gstring.glyph_size = sizeof (MFLTGlyph);
-      gstring.glyphs = malloc (sizeof (MFLTGlyph) * gstring.allocated);
+      gstring.glyphs = xmalloc (sizeof (MFLTGlyph) * gstring.allocated);
     }
   else if (gstring.allocated < len * 2)
     {
       gstring.allocated = len * 2;
-      gstring.glyphs = realloc (gstring.glyphs,
+      gstring.glyphs = xrealloc (gstring.glyphs,
                                sizeof (MFLTGlyph) * gstring.allocated);
     }
   memset (gstring.glyphs, 0, sizeof (MFLTGlyph) * len);
@@ -2092,7 +2092,7 @@
       if (result != -2)
        break;
       gstring.allocated += gstring.allocated;
-      gstring.glyphs = realloc (gstring.glyphs,
+      gstring.glyphs = xrealloc (gstring.glyphs,
                                sizeof (MFLTGlyph) * gstring.allocated);
     }
   if (gstring.used > LGSTRING_GLYPH_LEN (lgstring))




reply via email to

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