mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.4'
* PHP-8.4: Fix technically incorrect sizeof
This commit is contained in:
commit
32c6ac9133
1 changed files with 2 additions and 2 deletions
|
@ -229,7 +229,7 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
|
||||||
for (n = 1; (sai = sai->ai_next) != NULL; n++)
|
for (n = 1; (sai = sai->ai_next) != NULL; n++)
|
||||||
;
|
;
|
||||||
|
|
||||||
*sal = safe_emalloc((n + 1), sizeof(*sal), 0);
|
*sal = safe_emalloc((n + 1), sizeof(**sal), 0);
|
||||||
sai = res;
|
sai = res;
|
||||||
sap = *sal;
|
sap = *sal;
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
|
||||||
in = *((struct in_addr *) host_info->h_addr);
|
in = *((struct in_addr *) host_info->h_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
*sal = safe_emalloc(2, sizeof(*sal), 0);
|
*sal = safe_emalloc(2, sizeof(**sal), 0);
|
||||||
sap = *sal;
|
sap = *sal;
|
||||||
*sap = emalloc(sizeof(struct sockaddr_in));
|
*sap = emalloc(sizeof(struct sockaddr_in));
|
||||||
(*sap)->sa_family = AF_INET;
|
(*sap)->sa_family = AF_INET;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue