Skip to content

Commit 211f4ce

Browse files
committed
Check the return value of lo_export.
Patch by Ondřej Surý. Fixes bug #68697 (lo_export return -1 on failure).
1 parent d512341 commit 211f4ce

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ PHP NEWS
4747
. Fixed bug #66679 (Alignment Bug in PCRE 8.34 upstream).
4848
(Rainer Jung, Anatol Belski)
4949

50+
- pgsql:
51+
. Fixed bug #68697 (lo_export return -1 on failure). (Ondřej Surý)
52+
5053
- PDO_mysql
5154
. Fixed bug #68424 (Add new PDO mysql connection attr to control multi
5255
statements option). (peter dot wolanin at acquia dot com)

ext/pgsql/pgsql.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3631,10 +3631,10 @@ PHP_FUNCTION(pg_lo_export)
36313631

36323632
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
36333633

3634-
if (lo_export(pgsql, oid, file_out)) {
3635-
RETURN_TRUE;
3634+
if (lo_export(pgsql, oid, file_out) == -1) {
3635+
RETURN_FALSE;
36363636
}
3637-
RETURN_FALSE;
3637+
RETURN_TRUE;
36383638
}
36393639
/* }}} */
36403640

0 commit comments

Comments
 (0)