mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
ext/sockets: cmsg data array elements using uint32_t type instead. (#19254)
This commit is contained in:
parent
63e40b1b29
commit
4a0ad9bd91
1 changed files with 5 additions and 5 deletions
|
@ -930,7 +930,7 @@ static void from_zval_write_control_array(const zval *arr, char *msghdr_c, ser_c
|
||||||
char *bufp = buf;
|
char *bufp = buf;
|
||||||
zval *elem;
|
zval *elem;
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
int num_elems;
|
uint32_t num_elems;
|
||||||
void *control_buf;
|
void *control_buf;
|
||||||
zend_llist_element *alloc;
|
zend_llist_element *alloc;
|
||||||
size_t control_len,
|
size_t control_len,
|
||||||
|
@ -1102,7 +1102,7 @@ static void from_zval_write_iov_array_aux(zval *elem, unsigned i, void **args, s
|
||||||
}
|
}
|
||||||
static void from_zval_write_iov_array(const zval *arr, char *msghdr_c, ser_context *ctx)
|
static void from_zval_write_iov_array(const zval *arr, char *msghdr_c, ser_context *ctx)
|
||||||
{
|
{
|
||||||
int num_elem;
|
uint32_t num_elem;
|
||||||
struct msghdr *msg = (struct msghdr*)msghdr_c;
|
struct msghdr *msg = (struct msghdr*)msghdr_c;
|
||||||
|
|
||||||
if (Z_TYPE_P(arr) != IS_ARRAY) {
|
if (Z_TYPE_P(arr) != IS_ARRAY) {
|
||||||
|
@ -1361,7 +1361,7 @@ void to_zval_read_ucred(const char *data, zval *zv, res_context *ctx)
|
||||||
#ifdef SCM_RIGHTS
|
#ifdef SCM_RIGHTS
|
||||||
size_t calculate_scm_rights_space(const zval *arr, ser_context *ctx)
|
size_t calculate_scm_rights_space(const zval *arr, ser_context *ctx)
|
||||||
{
|
{
|
||||||
int num_elems;
|
uint32_t num_elems;
|
||||||
|
|
||||||
if (Z_TYPE_P(arr) != IS_ARRAY) {
|
if (Z_TYPE_P(arr) != IS_ARRAY) {
|
||||||
do_from_zval_err(ctx, "%s", "expected an array here");
|
do_from_zval_err(ctx, "%s", "expected an array here");
|
||||||
|
@ -1374,7 +1374,7 @@ size_t calculate_scm_rights_space(const zval *arr, ser_context *ctx)
|
||||||
return (size_t)-1;
|
return (size_t)-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return zend_hash_num_elements(Z_ARRVAL_P(arr)) * sizeof(int);
|
return num_elems * sizeof(int);
|
||||||
}
|
}
|
||||||
static void from_zval_write_fd_array_aux(zval *elem, unsigned i, void **args, ser_context *ctx)
|
static void from_zval_write_fd_array_aux(zval *elem, unsigned i, void **args, ser_context *ctx)
|
||||||
{
|
{
|
||||||
|
@ -1420,7 +1420,7 @@ void from_zval_write_fd_array(const zval *arr, char *int_arr, ser_context *ctx)
|
||||||
void to_zval_read_fd_array(const char *data, zval *zv, res_context *ctx)
|
void to_zval_read_fd_array(const char *data, zval *zv, res_context *ctx)
|
||||||
{
|
{
|
||||||
size_t *cmsg_len;
|
size_t *cmsg_len;
|
||||||
int num_elems,
|
uint32_t num_elems,
|
||||||
i;
|
i;
|
||||||
struct cmsghdr *dummy_cmsg = 0;
|
struct cmsghdr *dummy_cmsg = 0;
|
||||||
size_t data_offset;
|
size_t data_offset;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue