Don't accept null in pg_unescape_bytea()

This is an error that slipped in via 8d37c37bcd.
pg_unescape_bytea() did not accept null in PHP 7.4, and it is not
meaningful for it to accept null now -- it will always fail, and now
with a misleading OOM message.
This commit is contained in:
Nikita Popov 2020-10-13 15:36:09 +02:00
parent 8e531b5b00
commit 7b0f5f424d
3 changed files with 5 additions and 6 deletions

View file

@ -3359,8 +3359,7 @@ PHP_FUNCTION(pg_unescape_bytea)
char *from, *tmp;
size_t to_len;
size_t from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!",
&from, &from_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &from, &from_len) == FAILURE) {
RETURN_THROWS();
}