@* Fixed a possible crash in get_class_methods() (Zeev)

This commit is contained in:
Zeev Suraski 2000-12-22 12:08:04 +00:00
parent 3e28346336
commit 0fcce4a77a

View File

@ -1029,8 +1029,10 @@ ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong
if (p) { if (p) {
if (p->nKeyLength) { if (p->nKeyLength) {
*str_index = (char *) pemalloc(p->nKeyLength, ht->persistent); *str_index = (char *) estrndup(p->arKey, p->nKeyLength);
memcpy(*str_index, p->arKey, p->nKeyLength); if (ht->persistent) {
persist_alloc(*str_index);
}
if (str_length) { if (str_length) {
*str_length = p->nKeyLength; *str_length = p->nKeyLength;
} }