com php-src: Check the return value of lo_export.: NEWS ext/pgsql/pgsql.c
| From: | Adam Harvey | Date: | Tue, 30 Dec 2014 17:47:19 +0000 |
| Subject: | com php-src: Check the return value of lo_export.: NEWS ext/pgsql/pgsql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83939@lists.php.net to get a copy of this message | ||
Commit: 211f4ceeaec62929eb1e217ceadaac037b1cb799
Author: Adam Harvey <aharvey@php.net> Tue, 30 Dec 2014 17:47:19 +0000
Parents: d5123415f680b9c70ec44309f0bce3f0a512ee52
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=211f4ceeaec62929eb1e217ceadaac037b1cb799
Log:
Check the return value of lo_export.
Patch by Ondřej Surý. Fixes bug #68697 (lo_export return -1 on failure).
Bugs:
https://bugs.php.net/68697
Changed paths:
M NEWS
M ext/pgsql/pgsql.c
Diff:
diff --git a/NEWS b/NEWS
index 9b2fd10..f91a555 100644
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,9 @@ PHP NEWS
. Fixed bug #66679 (Alignment Bug in PCRE 8.34 upstream).
(Rainer Jung, Anatol Belski)
+- pgsql:
+ . Fixed bug #68697 (lo_export return -1 on failure). (Ondřej Surý)
+
- PDO_mysql
. Fixed bug #68424 (Add new PDO mysql connection attr to control multi
statements option). (peter dot wolanin at acquia dot com)
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index e2b417e..e60d420 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3631,10 +3631,10 @@ PHP_FUNCTION(pg_lo_export)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link,
le_plink);
- if (lo_export(pgsql, oid, file_out)) {
- RETURN_TRUE;
+ if (lo_export(pgsql, oid, file_out) == -1) {
+ RETURN_FALSE;
}
- RETURN_FALSE;
+ RETURN_TRUE;
}
/* }}} */