head 1.1; access; symbols pkgsrc-2026Q3:1.1.0.2; locks; strict; comment @ * @; 1.1 date 2026.10.22.02.06.45; author taca; state Exp; branches 1.1.2.1; next ; commitid Wi6Qo1a7ewgzMp0H; 1.1.2.1 date 2026.10.22.02.06.45; author maya; state dead; branches; next 1.1.2.2; commitid gZ0YLeL6EcmpcL2H; 1.1.2.2 date 2026.11.09.08.06.42; author maya; state Exp; branches; next ; commitid gZ0YLeL6EcmpcL2H; desc @@ 1.1 log @lang/php74: Apply changes from PHP-7.4-CVE-2026-109618-109619 Apply changes from tagged as PHP-7.4-CVE-2026-109618-109619 from GitHub. Quote from security advisory announce on https://www.php.net: Given the severity of these vulnerabilities, the PHP security team provided minimal source-backports for PHP 7.4, PHP 8.0, and PHP 8.1 to help people building from source or without access to an LTS vendor. Bump PKGREVISION. @ text @$NetBSD$ Fix for CVE-2026-109618-109619. --- Zend/zend_hash.c.orig 2022-10-31 10:36:16.000000000 +0000 +++ Zend/zend_hash.c @@@@ -97,7 +97,7 @@@@ static zend_always_inline uint32_t zend_ if (nSize <= HT_MIN_SIZE) { return HT_MIN_SIZE; } else if (UNEXPECTED(nSize >= HT_MAX_SIZE)) { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket)); + zend_mm_safe_error_ex("Possible integer overflow in memory allocation (%u * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket)); } #if defined(ZEND_WIN32) @@@@ -251,6 +251,13 @@@@ ZEND_API HashTable* ZEND_FASTCALL _zend_ return ht; } +ZEND_API HashTable* ZEND_FASTCALL zend_new_array_singleton(void) +{ + HashTable *ht = _zend_new_array_0(); + ht->nTableSize = 1; + return ht; +} + ZEND_API HashTable* ZEND_FASTCALL _zend_new_array(uint32_t nSize) { HashTable *ht = emalloc(sizeof(HashTable)); @@@@ -282,7 +289,7 @@@@ static void ZEND_FASTCALL zend_hash_pack { HT_ASSERT_RC1(ht); if (ht->nTableSize >= HT_MAX_SIZE) { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket), sizeof(Bucket)); + zend_mm_safe_error_ex("Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket), sizeof(Bucket)); } ht->nTableSize += ht->nTableSize; HT_SET_DATA_ADDR(ht, perealloc2(HT_GET_DATA_ADDR(ht), HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK), HT_USED_SIZE(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT)); @@@@ -1164,7 +1171,7 @@@@ static void ZEND_FASTCALL zend_hash_do_r pefree(old_data, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); zend_hash_rehash(ht); } else { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket) + sizeof(uint32_t), sizeof(Bucket)); + zend_mm_safe_error_ex("Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket) + sizeof(uint32_t), sizeof(Bucket)); } } @ 1.1.2.1 log @file patch-Zend_zend__hash.c was added on branch pkgsrc-2026Q3 on 2026-11-09 08:06:42 +0000 @ text @d1 47 @ 1.1.2.2 log @Pullup ticket #7332 - requested by taca lang/php74: Security fix Revisions pulled up: - lang/php74/Makefile 1.40 - lang/php74/distinfo 1.48 - lang/php74/patches/patch-Zend_zend__API.h 1.1 - lang/php74/patches/patch-Zend_zend__alloc.c 1.1 - lang/php74/patches/patch-Zend_zend__alloc.h 1.1 - lang/php74/patches/patch-Zend_zend__execute__API.c 1.1 - lang/php74/patches/patch-Zend_zend__hash.c 1.1 - lang/php74/patches/patch-Zend_zend__hash.h 1.1 - lang/php74/patches/patch-Zend_zend__llist.c 1.1 - lang/php74/patches/patch-Zend_zend__multiply.h 1.1 - lang/php74/patches/patch-Zend_zend__strtod.c 1.1 - lang/php74/patches/patch-Zend_zend__types.h 1.1 - lang/php74/patches/patch-Zend_zend__vm__def.h 1.1 - lang/php74/patches/patch-Zend_zend__vm__execute.h 1.1 - lang/php74/patches/patch-ext_session_session.c 1.1 - lang/php74/patches/patch-main_SAPI.c 1.1 - lang/php74/patches/patch-main_main.c 1.1 - lang/php74/patches/patch-main_php__variables.c 1.1 - lang/php74/patches/patch-main_rfc1867.c 1.1 --- Module Name: pkgsrc Committed By: taca Date: Thu Oct 22 02:06:46 UTC 2026 Modified Files: pkgsrc/lang/php74: Makefile distinfo Added Files: pkgsrc/lang/php74/patches: patch-Zend_zend__API.h patch-Zend_zend__alloc.c patch-Zend_zend__alloc.h patch-Zend_zend__execute__API.c patch-Zend_zend__hash.c patch-Zend_zend__hash.h patch-Zend_zend__llist.c patch-Zend_zend__multiply.h patch-Zend_zend__strtod.c patch-Zend_zend__types.h patch-Zend_zend__vm__def.h patch-Zend_zend__vm__execute.h patch-ext_session_session.c patch-main_SAPI.c patch-main_main.c patch-main_php__variables.c patch-main_rfc1867.c Log Message: lang/php74: Apply changes from PHP-7.4-CVE-2026-109618-109619 Apply changes from tagged as PHP-7.4-CVE-2026-109618-109619 from GitHub. Quote from security advisory announce on https://www.php.net: Given the severity of these vulnerabilities, the PHP security team provided minimal source-backports for PHP 7.4, PHP 8.0, and PHP 8.1 to help people building from source or without access to an LTS vendor. Bump PKGREVISION. @ text @a0 47 $NetBSD: patch-Zend_zend__hash.c,v 1.1 2026/10/22 02:06:45 taca Exp $ Fix for CVE-2026-109618-109619. --- Zend/zend_hash.c.orig 2022-10-31 10:36:16.000000000 +0000 +++ Zend/zend_hash.c @@@@ -97,7 +97,7 @@@@ static zend_always_inline uint32_t zend_ if (nSize <= HT_MIN_SIZE) { return HT_MIN_SIZE; } else if (UNEXPECTED(nSize >= HT_MAX_SIZE)) { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket)); + zend_mm_safe_error_ex("Possible integer overflow in memory allocation (%u * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket)); } #if defined(ZEND_WIN32) @@@@ -251,6 +251,13 @@@@ ZEND_API HashTable* ZEND_FASTCALL _zend_ return ht; } +ZEND_API HashTable* ZEND_FASTCALL zend_new_array_singleton(void) +{ + HashTable *ht = _zend_new_array_0(); + ht->nTableSize = 1; + return ht; +} + ZEND_API HashTable* ZEND_FASTCALL _zend_new_array(uint32_t nSize) { HashTable *ht = emalloc(sizeof(HashTable)); @@@@ -282,7 +289,7 @@@@ static void ZEND_FASTCALL zend_hash_pack { HT_ASSERT_RC1(ht); if (ht->nTableSize >= HT_MAX_SIZE) { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket), sizeof(Bucket)); + zend_mm_safe_error_ex("Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket), sizeof(Bucket)); } ht->nTableSize += ht->nTableSize; HT_SET_DATA_ADDR(ht, perealloc2(HT_GET_DATA_ADDR(ht), HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK), HT_USED_SIZE(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT)); @@@@ -1164,7 +1171,7 @@@@ static void ZEND_FASTCALL zend_hash_do_r pefree(old_data, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); zend_hash_rehash(ht); } else { - zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket) + sizeof(uint32_t), sizeof(Bucket)); + zend_mm_safe_error_ex("Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket) + sizeof(uint32_t), sizeof(Bucket)); } } @