1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Deprecate ZEND_SIZE_MAX and point to SIZE_MAX directly (#19244)

This commit is contained in:
Marc Bennewitz
2025-11-16 09:02:20 +01:00
committed by GitHub
parent 0194b381d6
commit 035f95cf5e
2 changed files with 3 additions and 14 deletions

View File

@@ -62,19 +62,8 @@ typedef enum {
typedef ZEND_RESULT_CODE zend_result;
#ifdef ZEND_ENABLE_ZVAL_LONG64
# ifdef ZEND_WIN32
# define ZEND_SIZE_MAX _UI64_MAX
# else
# define ZEND_SIZE_MAX SIZE_MAX
# endif
#else
# if defined(ZEND_WIN32)
# define ZEND_SIZE_MAX _UI32_MAX
# else
# define ZEND_SIZE_MAX SIZE_MAX
# endif
#endif
/* This constant is deprecated, use SIZE_MAX instead */
#define ZEND_SIZE_MAX SIZE_MAX
#ifdef ZTS
#define ZEND_TLS static TSRM_TLS

View File

@@ -103,7 +103,7 @@ php_sprintf_appendstring(zend_string **buffer, size_t *pos, char *add,
if (req_size > ZSTR_LEN(*buffer)) {
size_t size = ZSTR_LEN(*buffer);
while (req_size > size) {
if (size > ZEND_SIZE_MAX/2) {
if (size > SIZE_MAX/2) {
zend_error_noreturn(E_ERROR, "Field width %zd is too long", req_size);
}
size <<= 1;