diff --git a/NEWS b/NEWS index a3b9a4c6c00..58f290ae8b5 100644 --- a/NEWS +++ b/NEWS @@ -47,6 +47,9 @@ PHP NEWS - PDO_PGSQL: . Fixed error message allocation of PDO PgSQL. (SATO Kentaro) +- Sockets: + . Avoid void* arithmetic in sockets/multicast.c on NetBSD. (David Carlier) + - Spl: . Fixed bug #75917 (SplFileObject::seek broken with CSV flags). (Aliaksandr Bystry) diff --git a/Zend/zend_cpuinfo.c b/Zend/zend_cpuinfo.c index 57889bb3f4c..08843a9401f 100644 --- a/Zend/zend_cpuinfo.c +++ b/Zend/zend_cpuinfo.c @@ -75,7 +75,7 @@ static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo #if defined(__i386__) || defined(__x86_64__) /* Function based on compiler-rt implementation. */ -static unsigned get_xcr0_eax() { +static unsigned get_xcr0_eax(void) { # if defined(__GNUC__) || defined(__clang__) // Check xgetbv; this uses a .byte sequence instead of the instruction // directly because older assemblers do not include support for xgetbv and @@ -90,7 +90,7 @@ static unsigned get_xcr0_eax() { # endif } -static bool is_avx_supported() { +static bool is_avx_supported(void) { if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_AVX)) { /* No support for AVX */ return 0; diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index 0b2f10d09fb..f713d44ff88 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -784,7 +784,7 @@ int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *i } for (p = if_conf.ifc_buf; - p < if_conf.ifc_buf + if_conf.ifc_len; + p < ((char *)if_conf.ifc_buf) + if_conf.ifc_len; p += entry_len) { /* p may be misaligned on macos. */ struct ifreq cur_req;