Skip to content

Commit 2f20f98

Browse files
committed
Promote warning about length larger than buffer size
1 parent a1175d6 commit 2f20f98

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ext/pgsql/pgsql.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,9 +2637,8 @@ PHP_FUNCTION(pg_lo_write)
26372637
RETURN_THROWS();
26382638
}
26392639
if (z_len > (zend_long)str_len) {
2640-
/* TODO Promote to ValueError? */
2641-
php_error_docref(NULL, E_WARNING, "Cannot write more than buffer size %zu. Tried to write " ZEND_LONG_FMT, str_len, z_len);
2642-
RETURN_FALSE;
2640+
zend_argument_value_error(3, "must be less than or equal to the length of argument #2 ($buf)");
2641+
RETURN_THROWS();
26432642
}
26442643
len = z_len;
26452644
}

0 commit comments

Comments
 (0)