From: Jinesh Patel Date: Mon, 29 Jul 2019 18:21:25 +0000 (-0400) Subject: Fix length of key passed to zend_hash_str_find_ptr X-Git-Tag: php-7.2.24RC1~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d6c2448a7b0276c2e72249aa1efb4fcffdc96d8;p=php Fix length of key passed to zend_hash_str_find_ptr --- diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c index a16e7c8cbb..5c90fe2d2c 100644 --- a/ext/sockets/sendrecvmsg.c +++ b/ext/sockets/sendrecvmsg.c @@ -106,7 +106,7 @@ static void init_ancillary_registry(void) entry.to_array = to; \ key.cmsg_level = level; \ key.cmsg_type = type; \ - zend_hash_str_update_mem(&ancillary_registry.ht, (char*)&key, sizeof(key) - 1, (void*)&entry, sizeof(entry)) + zend_hash_str_update_mem(&ancillary_registry.ht, (char*)&key, sizeof(key), (void*)&entry, sizeof(entry)) #if defined(IPV6_PKTINFO) && HAVE_IPV6 PUT_ENTRY(sizeof(struct in6_pktinfo), 0, 0, from_zval_write_in6_pktinfo, @@ -156,7 +156,7 @@ ancillary_reg_entry *get_ancillary_reg_entry(int cmsg_level, int msg_type) tsrm_mutex_unlock(ancillary_mutex); #endif - if ((entry = zend_hash_str_find_ptr(&ancillary_registry.ht, (char*)&key, sizeof(key) - 1)) != NULL) { + if ((entry = zend_hash_str_find_ptr(&ancillary_registry.ht, (char*)&key, sizeof(key))) != NULL) { return entry; } else { return NULL;