Fix buffer overflow in `read-line'.
authorLudovic Courtès <ludo@gnu.org>
Wed, 26 Jan 2011 23:15:58 +0000 (00:15 +0100)
committerLudovic Courtès <ludo@gnu.org>
Wed, 26 Jan 2011 23:15:58 +0000 (00:15 +0100)
* libguile/rdelim.c (SCM_DEFINE): Compare INDEX to LINE_BUFFER_SIZE, not
  `sizeof (buf)'.

libguile/rdelim.c

index 760aa47..9d14967 100644 (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.  */