mirror of
https://github.com/php/php-src.git
synced 2026-04-19 22:11:12 +02:00
@- fixed crash in OCIParse when parsing invalid SQL. (Thies)
This commit is contained in:
@@ -1098,7 +1098,9 @@ static oci_statement *oci_parse(oci_connection *connection, char *query, int len
|
||||
OCI_NTV_SYNTAX,
|
||||
OCI_DEFAULT));
|
||||
if (connection->error) {
|
||||
/* XXX loose memory */
|
||||
OCIHandleFree(statement->pStmt, OCI_HTYPE_STMT);
|
||||
OCIHandleFree(statement->pError, OCI_HTYPE_ERROR);
|
||||
efree(statement);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -3680,7 +3682,11 @@ PHP_FUNCTION(ociparse)
|
||||
|
||||
statement = oci_parse(connection,(*query)->value.str.val,(*query)->value.str.len);
|
||||
|
||||
RETURN_RESOURCE(statement->id);
|
||||
if (statement) {
|
||||
RETURN_RESOURCE(statement->id);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
Reference in New Issue
Block a user