~ chicken-core (chicken-5) e35102c68e73053ab1461d00a8325ba8c753d90b


commit e35102c68e73053ab1461d00a8325ba8c753d90b
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Apr 25 22:23:18 2011 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Mon Apr 25 22:23:18 2011 +0200

    handle invalid size in server-response

diff --git a/setup-download.scm b/setup-download.scm
index f596d5bd..ca1c171e 100644
--- a/setup-download.scm
+++ b/setup-download.scm
@@ -360,8 +360,10 @@
 
   (define (read-chunks in)
     (let get-chunks ([data '()])
-      (let ([size (string->number (read-line in) 16)])
-	(cond ((zero? size)
+      (let ((size (string->number (read-line in) 16)))
+	(cond ((not size)
+	       (error "invalid response from server - please try again"))
+              ((zero? size)
 	       (d "~%")
 	       (string-concatenate-reverse data))
 	      (else
Trap