From 254e2d0626e1c9b5bfb40240b3bd04c72ef5b184 Mon Sep 17 00:00:00 2001 From: "Taylor R. Campbell" Date: Sun, 25 Dec 2005 05:56:58 +0000 Subject: [PATCH] Protect against EOF in NNTP-READ-LINE, which causes segfaults elsewhere if unchecked. --- v7/src/edwin/nntp.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/v7/src/edwin/nntp.scm b/v7/src/edwin/nntp.scm index 5a3287427..26d3d8f62 100644 --- a/v7/src/edwin/nntp.scm +++ b/v7/src/edwin/nntp.scm @@ -1,9 +1,9 @@ #| -*-Scheme-*- -$Id: nntp.scm,v 1.29 2004/06/07 19:49:38 cph Exp $ +$Id: nntp.scm,v 1.30 2005/12/25 05:56:58 riastradh Exp $ Copyright 1995,1996,1997,1998,1999,2003 Massachusetts Institute of Technology -Copyright 2004 Massachusetts Institute of Technology +Copyright 2004,2005 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -403,7 +403,10 @@ USA. (output-port/flush-output (nntp-connection:port connection))) (define (nntp-read-line connection) - (input-port/read-line (nntp-connection:port connection))) + (let ((line (input-port/read-line (nntp-connection:port connection)))) + (if (eof-object? line) + (error "Premature EOF from NNTP connection:" connection)) + line)) (define (nntp-response-number line) (if (fix:< (string-length line) 3) -- 2.25.1