summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Harvey <aharvey@php.net>2014-12-30 17:47:19 +0000
committerAdam Harvey <aharvey@php.net>2014-12-30 17:47:19 +0000
commit211f4ceeaec62929eb1e217ceadaac037b1cb799 (patch)
treed3db9beaf550c3e566f863aaf00962f1a7df56e2
parentd5123415f680b9c70ec44309f0bce3f0a512ee52 (diff)
downloadphp-git-211f4ceeaec62929eb1e217ceadaac037b1cb799.tar.gz
Check the return value of lo_export.
Patch by Ondřej Surý. Fixes bug #68697 (lo_export return -1 on failure).
-rw-r--r--NEWS3
-rw-r--r--ext/pgsql/pgsql.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 9b2fd10b8f..f91a555d14 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 e2b417ea2c..e60d420f96 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;
}
/* }}} */