]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.2' into PHP-7.3
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 25 Sep 2019 08:34:25 +0000 (10:34 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 25 Sep 2019 08:34:25 +0000 (10:34 +0200)
1  2 
ext/intl/msgformat/msgformat_helpers.cpp

index f8e3273f5ddab8e392b8e30a11ced63c6b6776a7,3e9b0d7f52e38f074509656d57936011c1b0eecd..eb1ad123d63848e68b743995b07aea935215decb
@@@ -191,11 -185,15 +191,11 @@@ static HashTable *umsg_parse_format(Mes
  
                if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NAME) {
                        UnicodeString argName = mp.getSubstring(name_part);
-                       if ((storedType = (Formattable::Type*)zend_hash_str_find_ptr(ret, (char*)argName.getBuffer(), argName.length())) == NULL) {
+                       if ((storedType = (Formattable::Type*)zend_hash_str_find_ptr(ret, (char*)argName.getBuffer(), argName.length() * sizeof(UChar))) == NULL) {
                                /* not found already; create new entry in HT */
                                Formattable::Type bogusType = Formattable::kObject;
-                               storedType = (Formattable::Type*)zend_hash_str_update_mem(ret, (char*)argName.getBuffer(), argName.length(),
 -                              if ((storedType = (Formattable::Type*)zend_hash_str_update_mem(ret, (char*)argName.getBuffer(), argName.length() * sizeof(UChar),
 -                                              (void*)&bogusType, sizeof(bogusType))) == NULL) {
 -                                      intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
 -                                              "Write to argument types hash table failed", 0);
 -                                      continue;
 -                              }
++                              storedType = (Formattable::Type*)zend_hash_str_update_mem(ret, (char*)argName.getBuffer(), argName.length() * sizeof(UChar),
 +                                              (void*)&bogusType, sizeof(bogusType));
                        }
                } else if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NUMBER) {
                        int32_t argNumber = name_part.getValue();