From 8f9e1abdafe8e58e544567b41bd6f5bcc789d2e7 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Thu, 16 Jul 2026 14:01:27 -0300 Subject: [PATCH] Empty strings result in a function sequence error on PASE It makes no sense to use them. --- ibm_db2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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);