mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Fix uninitialized variable accesses in sockets/conversions
This commit is contained in:
commit
8a1cbdd7df
@ -720,6 +720,10 @@ static void from_zval_write_sockaddr_aux(const zval *container,
|
||||
zend_llist_add_element(&ctx->keys, &node);
|
||||
from_zval_write_int(elem, (char*)&family, ctx);
|
||||
zend_llist_remove_tail(&ctx->keys);
|
||||
|
||||
if (UNEXPECTED(ctx->err.has_error)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
family = ctx->sock->type;
|
||||
}
|
||||
@ -1115,7 +1119,10 @@ static void from_zval_write_controllen(const zval *elem, char *msghdr_c, ser_con
|
||||
* this least common denominator
|
||||
*/
|
||||
from_zval_write_uint32(elem, (char*)&len, ctx);
|
||||
if (!ctx->err.has_error && len == 0) {
|
||||
if (ctx->err.has_error) {
|
||||
return;
|
||||
}
|
||||
if (len == 0) {
|
||||
do_from_zval_err(ctx, "controllen cannot be 0");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user