Merge branch 'PHP-8.1' into PHP-8.2

* PHP-8.1:
  Fix uninitialized variable accesses in sockets/conversions
This commit is contained in:
Niels Dossche 2023-03-29 19:47:38 +02:00
commit 8a1cbdd7df

View File

@ -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;
}