summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2005-04-14 22:39:33 (GMT)
committerhobbs <hobbs>2005-04-14 22:39:33 (GMT)
commit9295daaaad625b41892d939729104763a2d2b3ce (patch)
treeb716c4effc24dffe2cbba737a1f97a90f7d300e4
parentce797b74d036be07403642fbc7356d8713572f13 (diff)
downloadtk-9295daaaad625b41892d939729104763a2d2b3ce.zip
tk-9295daaaad625b41892d939729104763a2d2b3ce.tar.gz
tk-9295daaaad625b41892d939729104763a2d2b3ce.tar.bz2
* unix/tkUnixFont.c (FontMapLoadPage): reorder char[] decls to
avoid possible segv. Minimal fix for [Bug 1122671]
-rw-r--r--ChangeLog5
-rw-r--r--unix/tkUnixFont.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 112dc0e..fcf93f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixFont.c (FontMapLoadPage): reorder char[] decls to
+ avoid possible segv. Minimal fix for [Bug 1122671]
+
2005-04-12 Jeff Hobbs <jeffh@ActiveState.com>
* library/tkfbox.tcl (::tk::dialog::file::): fix typeMenuLab ref.
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index e004acb..34d814d 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixFont.c,v 1.22 2004/01/13 02:06:01 davygrvy Exp $
+ * RCS: @(#) $Id: tkUnixFont.c,v 1.23 2005/04/14 22:39:34 hobbs Exp $
*/
#include "tkUnixInt.h"
@@ -2054,7 +2054,7 @@ FontMapLoadPage(subFontPtr, row)
int row; /* Index of the page to be loaded into
* the cache. */
{
- char src[TCL_UTF_MAX], buf[16];
+ char buf[16], src[TCL_UTF_MAX];
int minHi, maxHi, minLo, maxLo, scale, checkLo;
int i, end, bitOffset, isTwoByteFont, n;
Tcl_Encoding encoding;
@@ -2091,7 +2091,7 @@ FontMapLoadPage(subFontPtr, row)
end = (row + 1) << FONTMAP_SHIFT;
for (i = row << FONTMAP_SHIFT; i < end; i++) {
int hi, lo;
-
+
if (Tcl_UtfToExternal(NULL, encoding, src, Tcl_UniCharToUtf(i, src),
TCL_ENCODING_STOPONERROR, NULL, buf, sizeof(buf), NULL,
NULL, NULL) != TCL_OK) {