--- perl-tk-804.027.orig/objGlue.c +++ perl-tk-804.027/objGlue.c @@ -529,6 +529,10 @@ sv_utf8_upgrade(objPtr); #endif s = SvPV(objPtr, len); + if (!s) + { + return NULL; + } #ifdef SvUTF8 if (!is_utf8_string(s,len)) { @@ -555,6 +559,10 @@ else { s = LangString(objPtr); + if (!s) + { + return NULL; + } #ifdef SvUTF8 if (!is_utf8_string(s,strlen(s))) { --- perl-tk-804.027.orig/pTk/mTk/generic/tkFont.c +++ perl-tk-804.027/pTk/mTk/generic/tkFont.c @@ -1044,6 +1044,7 @@ TkFont *fontPtr, *firstFontPtr, *oldFontPtr; int new, descent; NamedFont *nfPtr; + char *fontString; fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr; if (objPtr->typePtr != &tkFontObjType) { @@ -1077,8 +1078,12 @@ cacheHashPtr = oldFontPtr->cacheHashPtr; FreeFontObjProc(objPtr); } else { + fontString = Tcl_GetString(objPtr); + if (fontString == NULL) { + fontString = ""; + } cacheHashPtr = Tcl_CreateHashEntry(&fiPtr->fontCache, - Tcl_GetString(objPtr), &new); + fontString, &new); } firstFontPtr = (TkFont *) Tcl_GetHashValue(cacheHashPtr); for (fontPtr = firstFontPtr; (fontPtr != NULL); @@ -1095,8 +1100,12 @@ * The desired font isn't in the table. Make a new one. */ + fontString = Tcl_GetString(objPtr); + if (fontString == NULL) { + fontString = ""; + } namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, - Tcl_GetString(objPtr)); + fontString); if (namedHashPtr != NULL) { /* * Construct a font based on a named font. @@ -1111,7 +1120,7 @@ * Native font? */ - fontPtr = TkpGetNativeFont(tkwin, Tcl_GetString(objPtr)); + fontPtr = TkpGetNativeFont(tkwin, fontString); if (fontPtr == NULL) { TkFontAttributes fa; Tcl_Obj *dupObjPtr = Tcl_DuplicateObj(objPtr);