summaryrefslogtreecommitdiff
path: root/ext/dbx
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dbx')
-rw-r--r--ext/dbx/dbx_fbsql.c4
-rw-r--r--ext/dbx/dbx_mssql.c4
-rw-r--r--ext/dbx/dbx_mysql.c4
-rw-r--r--ext/dbx/dbx_oci8.c4
-rw-r--r--ext/dbx/dbx_odbc.c4
-rw-r--r--ext/dbx/dbx_pgsql.c4
-rw-r--r--ext/dbx/dbx_sybasect.c4
7 files changed, 28 insertions, 0 deletions
diff --git a/ext/dbx/dbx_fbsql.c b/ext/dbx/dbx_fbsql.c
index 56c3764f0f..f12ed0870d 100644
--- a/ext/dbx/dbx_fbsql.c
+++ b/ext/dbx/dbx_fbsql.c
@@ -259,6 +259,10 @@ int dbx_fbsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION
char * tmpstr;
int tmplen;
+ if (Z_STRLEN_PP(string) == 0) {
+ ZVAL_EMPTY_STRING(*rv);
+ return 1;
+ }
tmpstr = estrdup(Z_STRVAL_PP(string));
tmplen = Z_STRLEN_PP(string);
/* php_str_to_str uses a smart_str that allocates memory */
diff --git a/ext/dbx/dbx_mssql.c b/ext/dbx/dbx_mssql.c
index 9ea38ca1eb..69ae42ba19 100644
--- a/ext/dbx/dbx_mssql.c
+++ b/ext/dbx/dbx_mssql.c
@@ -258,6 +258,10 @@ int dbx_mssql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION
char * tmpstr;
int tmplen;
+ if (Z_STRLEN_PP(string) == 0) {
+ ZVAL_EMPTY_STRING(*rv);
+ return 1;
+ }
tmpstr = estrdup(Z_STRVAL_PP(string));
tmplen = Z_STRLEN_PP(string);
/* php_str_to_str uses a smart_str that allocates memory */
diff --git a/ext/dbx/dbx_mysql.c b/ext/dbx/dbx_mysql.c
index 3efd427038..b8149eae9d 100644
--- a/ext/dbx/dbx_mysql.c
+++ b/ext/dbx/dbx_mysql.c
@@ -266,6 +266,10 @@ int dbx_mysql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION
char * tmpstr;
int tmplen;
+ if (Z_STRLEN_PP(string) == 0) {
+ ZVAL_EMPTY_STRING(*rv);
+ return 1;
+ }
arguments[0]=string;
arguments[1]=dbx_handle;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_real_escape_string", &returned_zval, number_of_arguments, arguments);
diff --git a/ext/dbx/dbx_oci8.c b/ext/dbx/dbx_oci8.c
index da50844334..bc69ee4553 100644
--- a/ext/dbx/dbx_oci8.c
+++ b/ext/dbx/dbx_oci8.c
@@ -276,6 +276,10 @@ int dbx_oci8_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_
char * tmpstr;
int tmplen;
+ if (Z_STRLEN_PP(string) == 0) {
+ ZVAL_EMPTY_STRING(*rv);
+ return 1;
+ }
tmpstr = estrdup(Z_STRVAL_PP(string));
tmplen = Z_STRLEN_PP(string);
/* php_str_to_str uses a smart_str that allocates memory */
diff --git a/ext/dbx/dbx_odbc.c b/ext/dbx/dbx_odbc.c
index 139855026b..ef3d575209 100644
--- a/ext/dbx/dbx_odbc.c
+++ b/ext/dbx/dbx_odbc.c
@@ -281,6 +281,10 @@ int dbx_odbc_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_
char * tmpstr;
int tmplen;
+ if (Z_STRLEN_PP(string) == 0) {
+ ZVAL_EMPTY_STRING(*rv);
+ return 1;
+ }
tmpstr = estrdup(Z_STRVAL_PP(string));
tmplen = Z_STRLEN_PP(string);
/* php_str_to_str uses a smart_str that allocates memory */
diff --git a/ext/dbx/dbx_pgsql.c b/ext/dbx/dbx_pgsql.c
index c8cac1908c..7642ee6488 100644
--- a/ext/dbx/dbx_pgsql.c
+++ b/ext/dbx/dbx_pgsql.c
@@ -285,6 +285,10 @@ int dbx_pgsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION
char * tmpstr;
int tmplen;
+ if (Z_STRLEN_PP(string) == 0) {
+ ZVAL_EMPTY_STRING(*rv);
+ return 1;
+ }
tmpstr = estrdup(Z_STRVAL_PP(string));
tmplen = Z_STRLEN_PP(string);
/* php_str_to_str uses a smart_str that allocates memory */
diff --git a/ext/dbx/dbx_sybasect.c b/ext/dbx/dbx_sybasect.c
index 3cc4830165..b5da105651 100644
--- a/ext/dbx/dbx_sybasect.c
+++ b/ext/dbx/dbx_sybasect.c
@@ -283,6 +283,10 @@ int dbx_sybasect_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCT
char * tmpstr;
int tmplen;
+ if (Z_STRLEN_PP(string) == 0) {
+ ZVAL_EMPTY_STRING(*rv);
+ return 1;
+ }
tmpstr = estrdup(Z_STRVAL_PP(string));
tmplen = Z_STRLEN_PP(string);
/* php_str_to_str uses a smart_str that allocates memory */