Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ PHP NEWS
. Fixed three Windows-only proc_open() defects: an uninitialized
PROCESS_INFORMATION, an indeterminate comspec pointer after a failed
lookup, and an unchecked CreateFileA() failure. (Ilia Alshanetsky)
. Fixed out-of-bounds read when parsing a malformed MX answer in
dns_get_mx(). (Ilia Alshanetsky)

- XSL:
. Fixed bug GH-23730 (use-after-free when XSLTProcessor::importStylesheet()
Expand Down
8 changes: 8 additions & 0 deletions ext/standard/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,13 +1120,21 @@ PHP_FUNCTION(dns_get_mx)
RETURN_FALSE;
}
cp += i;
if (cp + 10 > end) {
php_dns_free_handle(handle);
RETURN_FALSE;
}
GETSHORT(type, cp);
cp += INT16SZ + INT32SZ;
GETSHORT(i, cp);
if (type != DNS_T_MX) {
cp += i;
continue;
}
if (cp + 2 > end) {
php_dns_free_handle(handle);
RETURN_FALSE;
}
GETSHORT(weight, cp);
if ((i = dn_expand(answer.qb2, end, cp, buf, sizeof(buf)-1)) < 0) {
php_dns_free_handle(handle);
Expand Down
Loading