From 5abba5ee0ebcba55450f5106902a584c98e76258 Mon Sep 17 00:00:00 2001 From: Andy Sautins Date: Tue, 11 Sep 2001 23:15:18 +0000 Subject: [PATCH] Collection fix. Fix core dump when accessing an element that is not in the collection. --- ext/oci8/oci8.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 747a02625b..c2dbc1d2ee 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -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: -- 2.40.0