1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  Fix technically incorrect sizeof
This commit is contained in:
Niels Dossche
2025-06-09 22:05:21 +02:00

View File

@@ -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++)
;
*sal = safe_emalloc((n + 1), sizeof(*sal), 0);
*sal = safe_emalloc((n + 1), sizeof(**sal), 0);
sai = res;
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);
}
*sal = safe_emalloc(2, sizeof(*sal), 0);
*sal = safe_emalloc(2, sizeof(**sal), 0);
sap = *sal;
*sap = emalloc(sizeof(struct sockaddr_in));
(*sap)->sa_family = AF_INET;