1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-05 11:35:01 +00:00

- Added patch from tcl8.4

Certain character set encodings can cause tcl to core dump in
TclFinalizeEncodingSubsystem().
PR:		51273
Submitted by:	truckman
This commit is contained in:
Dirk Meyer 2003-04-22 18:14:06 +00:00
parent 960cd205ac
commit d024ce9c40
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=79466
2 changed files with 31 additions and 1 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= tcl
PORTVERSION= 8.3.5
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= lang tcl83
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= tcl

View File

@ -0,0 +1,30 @@
--- ../generic/tclEncoding.c.orig Thu Apr 5 13:28:52 2001
+++ ../generic/tclEncoding.c Thu Apr 10 00:49:34 2003
@@ -310,19 +310,19 @@
{
Tcl_HashSearch search;
Tcl_HashEntry *hPtr;
- Encoding *encodingPtr;
Tcl_MutexLock(&encodingMutex);
encodingsInitialized = 0;
hPtr = Tcl_FirstHashEntry(&encodingTable, &search);
while (hPtr != NULL) {
- encodingPtr = (Encoding *) Tcl_GetHashValue(hPtr);
- if (encodingPtr->freeProc != NULL) {
- (*encodingPtr->freeProc)(encodingPtr->clientData);
- }
- ckfree((char *) encodingPtr->name);
- ckfree((char *) encodingPtr);
- hPtr = Tcl_NextHashEntry(&search);
+ /*
+ * Call FreeEncoding instead of doing it directly to handle refcounts
+ * like escape encodings use. [Bug #524674]
+ * Make sure to call Tcl_FirstHashEntry repeatedly so that all
+ * encodings are eventually cleaned up.
+ */
+ FreeEncoding((Tcl_Encoding) Tcl_GetHashValue(hPtr));
+ hPtr = Tcl_FirstHashEntry(&encodingTable, &search);
}
Tcl_DeleteHashTable(&encodingTable);
Tcl_MutexUnlock(&encodingMutex);