summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXInit.c
diff options
context:
space:
mode:
authordas <das@noemail.net>2009-05-06 16:36:24 (GMT)
committerdas <das@noemail.net>2009-05-06 16:36:24 (GMT)
commitbdd54b638b47f5cf01054fdab6bd25bcc863ab07 (patch)
treed6c38aff405c340973b03561146c26341d1a5e51 /macosx/tkMacOSXInit.c
parentd39084f3207bf069e9713336e8eed5822fba1cca (diff)
downloadtk-bdd54b638b47f5cf01054fdab6bd25bcc863ab07.zip
tk-bdd54b638b47f5cf01054fdab6bd25bcc863ab07.tar.gz
tk-bdd54b638b47f5cf01054fdab6bd25bcc863ab07.tar.bz2
avoid panic for CFStrings longer than INT_MAX
FossilOrigin-Name: d2550d4f6fbde2e7925eeb7c6265ba999cb98092
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r--macosx/tkMacOSXInit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index f1b41cb..95b1508 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXInit.c,v 1.38 2008/12/15 16:17:18 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXInit.c,v 1.39 2009/05/06 16:36:24 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -581,7 +581,7 @@ TkMacOSXGetStringObjFromCFString(
CFIndex len;
if (CFStringGetBytes(str, all, kCFStringEncodingUTF8, 0, false, NULL,
- 0, &len) > 0) {
+ 0, &len) > 0 && len < INT_MAX) {
obj = Tcl_NewObj();
Tcl_SetObjLength(obj, len);
CFStringGetBytes(str, all, kCFStringEncodingUTF8, 0, false,