diff --git a/ibm_db2.c b/ibm_db2.c index 89be662..55af753 100644 --- a/ibm_db2.c +++ b/ibm_db2.c @@ -4038,6 +4038,11 @@ PHP_FUNCTION(db2_exec) return; } + if (!stmt_string || stmt_string_len < 1) { + zend_argument_value_error(2, "must be a non-empty string"); + return; + } + if (connection) { ZEND_FETCH_RESOURCE_2(conn_res, conn_handle*, &connection, connection_id, "Connection Resource", le_conn_struct, le_pconn_struct); @@ -4130,6 +4135,11 @@ PHP_FUNCTION(db2_prepare) return; } + if (!stmt_string || stmt_string_len < 1) { + zend_argument_value_error(2, "must be a non-empty string"); + return; + } + if (connection) { ZEND_FETCH_RESOURCE_2(conn_res, conn_handle*, &connection, connection_id, "Connection Resource", le_conn_struct, le_pconn_struct);