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

Fix technically incorrect sizeof

This doesn't actually matter because both `*sal` and `**sal` are pointer
sized, but this makes analysers happy.
Fixes bug #68866.

Closes GH-18816.
This commit is contained in:
Niels Dossche
2025-06-09 21:17:33 +02:00
parent d11f9717fd
commit fe3bea090e

View File

@@ -227,7 +227,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;
@@ -266,7 +266,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;