summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixFont.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2005-04-12 22:05:47 (GMT)
committerhobbs <hobbs>2005-04-12 22:05:47 (GMT)
commitbe6d9e33bed687b9fe2a04d816dd5f932a5764d1 (patch)
tree289c59c353186753a952ad9d5250f81176d918ea /unix/tkUnixFont.c
parent56d7376fb090c2f916062d0245252d6fdeaba8e4 (diff)
downloadtk-be6d9e33bed687b9fe2a04d816dd5f932a5764d1.zip
tk-be6d9e33bed687b9fe2a04d816dd5f932a5764d1.tar.gz
tk-be6d9e33bed687b9fe2a04d816dd5f932a5764d1.tar.bz2
* unix/tkUnixFont.c (FontMapLoadPage): reorder char[] decls to
avoid possible segv. Minimal fix for [Bug 1122671]
Diffstat (limited to 'unix/tkUnixFont.c')
-rw-r--r--unix/tkUnixFont.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 22ea02f..1de1b1f 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.18.2.3 2003/10/29 01:07:46 hobbs Exp $
+ * RCS: @(#) $Id: tkUnixFont.c,v 1.18.2.4 2005/04/12 22:05:47 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) {