We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a49962 commit 90dc920Copy full SHA for 90dc920
ext/pgsql/pgsql.c
@@ -2562,7 +2562,7 @@ PHP_FUNCTION(pg_lo_close)
2562
PHP_FUNCTION(pg_lo_read)
2563
{
2564
zval *pgsql_id;
2565
- zend_long len;
+ zend_long len = 0;
2566
size_t buf_len = PGSQL_LO_READ_BUF_SIZE;
2567
int nbytes;
2568
zend_string *buf;
@@ -2576,8 +2576,9 @@ PHP_FUNCTION(pg_lo_read)
2576
RETURN_THROWS();
2577
}
2578
2579
- if (ZEND_NUM_ARGS() > 1) {
2580
- buf_len = len < 0 ? 0 : len;
+ if (len < 0) {
+ zend_argument_value_error(2, "must be greater or equal than 0");
2581
+ RETURN_THROWS();
2582
2583
2584
buf = zend_string_alloc(buf_len, 0);
0 commit comments