Skip to content

Commit e4e6c3e

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Fix potential heap corruption due to alignment mismatch
2 parents dc817a6 + 3193c03 commit e4e6c3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/mysqlnd/mysqlnd_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ static char * _mysqlnd_pestrdup(const char * const ptr, bool persistent MYSQLND_
346346
smart_str_appendc(&tmp_str, *p);
347347
} while (*p++);
348348

349-
ret = pemalloc_rel(ZSTR_LEN(tmp_str.s) + sizeof(size_t), persistent);
349+
ret = pemalloc_rel(REAL_SIZE(ZSTR_LEN(tmp_str.s)), persistent);
350350
memcpy(FAKE_PTR(ret), ZSTR_VAL(tmp_str.s), ZSTR_LEN(tmp_str.s));
351351

352352
if (ret && collect_memory_statistics) {

0 commit comments

Comments
 (0)