Skip to content

Commit 3193c03

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Fix potential heap corruption due to alignment mismatch
2 parents 3b5a9da + 7e14d24 commit 3193c03

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.2.0RC5
44

5+
- MySQLnd:
6+
. Fixed potential heap corruption due to alignment mismatch. (cmb)
57

68
13 Oct 2022, PHP 8.2.0RC4
79

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)