com php-src: Fix setting of empty string resource.: ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.r e
| From: | Anatol Belski | Date: | Thu, 05 Nov 2015 18:47:12 +0000 |
| Subject: | com php-src: Fix setting of empty string resource.: ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.r e | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89601@lists.php.net to get a copy of this message | ||
Commit: 1fcadf67e652622577ab0467e40c812e132ec9f3
Author: Fabian Franz <fabian@root397.premium-rootserver.net> Thu, 5 Nov 2015
18:21:45 +0000
Committer: Anatol Belski <ab@php.net> Thu, 5 Nov 2015 19:47:12 +0100
Parents: f189353178bd8e88bee9590669dfd0c53b784b28
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1fcadf67e652622577ab0467e40c812e132ec9f3
Log:
Fix setting of empty string resource.
Changed paths:
M ext/pdo/pdo_sql_parser.c
M ext/pdo/pdo_sql_parser.re
Diff:
diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index 0907571..22e5fcf 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -576,8 +576,7 @@ safe:
buf = php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0);
if (!buf) {
- ret = -1;
- goto clean_up;
+ buf = ZSTR_EMPTY_ALLOC();
}
if (!stmt->dbh->methods->quoter(stmt->dbh, ZSTR_VAL(buf), ZSTR_LEN(buf),
&plc->quoted, &plc->qlen,
param->param_type)) {
diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser..re
index 96c131f..629f307 100644
--- a/ext/pdo/pdo_sql_parser.re
+++ b/ext/pdo/pdo_sql_parser.re
@@ -218,8 +218,7 @@ safe:
buf = php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0);
if (!buf) {
- ret = -1;
- goto clean_up;
+ buf = ZSTR_EMPTY_ALLOC();
}
if (!stmt->dbh->methods->quoter(stmt->dbh, ZSTR_VAL(buf), ZSTR_LEN(buf),
&plc->quoted, &plc->qlen,
param->param_type)) {