]> granicus.if.org Git - php/commitdiff
Collection fix. Fix core dump when accessing an element that is
authorAndy Sautins <asautins@php.net>
Tue, 11 Sep 2001 23:15:18 +0000 (23:15 +0000)
committerAndy Sautins <asautins@php.net>
Tue, 11 Sep 2001 23:15:18 +0000 (23:15 +0000)
not in the collection.

ext/oci8/oci8.c

index 747a02625b96567b1cf047646c10e36e63ffdd1c..c2dbc1d2eed04164aaf600d32115fab42de62928 100644 (file)
@@ -4638,6 +4638,11 @@ PHP_FUNCTION(ocicollgetelem)
                        oci_error(connection->pError, "OCICollGetElem", connection->error);
                        RETURN_FALSE;
                }
+               
+               // Return false if value does not exist at that location
+               if(exists == 0) {
+                       RETURN_FALSE;
+               }
 
                switch (coll->element_typecode) {
                   case OCI_TYPECODE_DATE: