1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Fix buffer overflow in `read-line'.

* libguile/rdelim.c (SCM_DEFINE): Compare INDEX to LINE_BUFFER_SIZE, not
  `sizeof (buf)'.
This commit is contained in:
Ludovic Courtès 2011-01-27 00:15:58 +01:00
parent 90cfcf8fa7
commit a7ea441163

View file

@ -139,7 +139,7 @@ SCM_DEFINE (scm_read_line, "%read-line", 0, 1, 0,
do
{
if (SCM_UNLIKELY (index >= sizeof (buf)))
if (SCM_UNLIKELY (index >= LINE_BUFFER_SIZE))
{
/* The line is getting longer than BUF so store its current
contents in STRINGS. */