]> granicus.if.org Git - php/commitdiff
fixes for bug #55748
authorStanislav Malyshev <stas@php.net>
Fri, 18 Nov 2011 07:11:19 +0000 (07:11 +0000)
committerStanislav Malyshev <stas@php.net>
Fri, 18 Nov 2011 07:11:19 +0000 (07:11 +0000)
Zend/zend_builtin_functions.c
ext/com_dotnet/com_typeinfo.c
ext/oci8/oci8.c
ext/standard/syslog.c

index aeacda54e208029eba7fb5353a0ee4b1ef06cc46..e4d6303839c9d909736e7f9e79ba666d42e648a4 100644 (file)
@@ -706,6 +706,9 @@ repeat:
        }
        c.flags = case_sensitive; /* non persistent */
        c.name = IS_INTERNED(name) ? name : zend_strndup(name, name_len);
+       if(name == NULL) {
+               RETURN_FALSE;
+       }
        c.name_len = name_len+1;
        c.module_number = PHP_USER_CONSTANT;
        if (zend_register_constant(&c TSRMLS_CC) == SUCCESS) {
index e2d5d28af5c893e2c9aa429b5eb910c53eca651d..2934c05933cecd7cfd6183c7a4c036949d0765d8 100644 (file)
@@ -187,6 +187,10 @@ PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC
                                const_name = php_com_olestring_to_string(bstr_ids, &c.name_len, codepage TSRMLS_CC);
                                c.name = zend_strndup(const_name, c.name_len);
                                efree(const_name);
+                               if(c.name == NULL) {
+                                       ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
+                                       continue;
+                               }
                                c.name_len++; /* include NUL */
                                SysFreeString(bstr_ids);
 
index 809ff816ae522280ce7828fe3ff2b911925cb88c..2b63a6faf5ace50b3c49e58377f53dabd50772b3 100644 (file)
@@ -2055,6 +2055,9 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
                } else {
                        connection = (php_oci_connection *) calloc(1, sizeof(php_oci_connection));
                        connection->hash_key = zend_strndup(hashed_details.c, hashed_details.len);
+                       if(connection->hash_key == NULL) {
+                               return NULL;
+                       }
                        connection->is_persistent = 1;
                }
        } else {
index 2abef4785997b98028003b35d6484df3d842ba2a..cc49cc5f4a90b6a5ee3b0d79ac936b2e3a5a948b 100644 (file)
@@ -146,6 +146,9 @@ PHP_FUNCTION(openlog)
                free(BG(syslog_device));
        }
        BG(syslog_device) = zend_strndup(ident, ident_len);
+       if(BG(syslog_device) == NULL) {
+               RETURN_FALSE;
+       }
        openlog(BG(syslog_device), option, facility);
        RETURN_TRUE;
 }