diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-21 15:46:55 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-21 15:46:55 +0200 |
| commit | d1bbc39e4cbf3068ac64e8b107814e0bb8ddc762 (patch) | |
| tree | ee05af3988e27052eac0d7a3c4706c7cbe045afb /ext/pgsql/pgsql.stub.php | |
| parent | 5bb41fa63cec0b25470c8202c58f019929dc29a6 (diff) | |
| download | php-git-d1bbc39e4cbf3068ac64e8b107814e0bb8ddc762.tar.gz | |
pg_unescape_bytea() can only fail on OOM
The implementation did not check for PQunescapeBytea failure
correctly, because it checked for a null pointer after estrndup,
which certainly cannot happen. Inspection of the PGunescapeBytea
implementation has shown that this function can only fail on OOM,
so let's check for that explicitly and remove false as a possible
return type.
While we're here, avoid an unnecessary copy of the result.
Diffstat (limited to 'ext/pgsql/pgsql.stub.php')
| -rw-r--r-- | ext/pgsql/pgsql.stub.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.stub.php b/ext/pgsql/pgsql.stub.php index e5e5300056..181d62c9cd 100644 --- a/ext/pgsql/pgsql.stub.php +++ b/ext/pgsql/pgsql.stub.php @@ -425,7 +425,7 @@ function pg_escape_string($connection, string $data = UNKNOWN): string {} /** @param resource|string $connection */ function pg_escape_bytea($connection, string $data = UNKNOWN): string {} -function pg_unescape_bytea(?string $data = null): string|false {} +function pg_unescape_bytea(?string $data = null): string {} /** @param resource|string $connection */ function pg_escape_literal($connection, string $data = UNKNOWN): string|false {} |
