]> granicus.if.org Git - php/commitdiff
Fix length of key passed to zend_hash_str_find_ptr
authorJinesh Patel <jineshpatel@jineshs-mbp.war.can.ibm.com>
Mon, 29 Jul 2019 18:21:25 +0000 (14:21 -0400)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sat, 21 Sep 2019 16:11:21 +0000 (18:11 +0200)
ext/sockets/sendrecvmsg.c

index a16e7c8cbbd1f4fec68a83eb66c083c018c6a5d5..5c90fe2d2c7bd0e2f5cdb8476708e690a225b5c0 100644 (file)
@@ -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;