Do not read a frame past EOF.
authorRutger van Beusekom <rutger.van.beusekom@verum.com>
Fri, 22 Nov 2019 21:36:08 +0000 (22:36 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 27 Jan 2020 17:41:20 +0000 (18:41 +0100)
* 8sync/systems/websocket/frame.scm (read-frame): Handle EOF.

8sync/systems/websocket/frame.scm

index 7a71dba9ff56483b44c222edef00b58e4d439280..831456a61cccb0580d9480cb7734f4be69ca2b89 100644 (file)
@@ -1,5 +1,6 @@
 ;;; guile-websocket --- WebSocket client/server
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
+;;; Copyright © 2019 Rutger van Beusekom <rutger.van.beusekom@gmail.com>
 ;;;
 ;;; This file is part of guile-websocket.
 ;;;
@@ -309,7 +310,8 @@ MASKING-KEY."
 
     (let ((bv (get-bytevector-n port length)))
       (when masking-key
-        (mask-bytevector! bv masking-key))
+        (unless (eof-object? bv)
+          (mask-bytevector! bv masking-key)))
       bv))
 
   (let* ((type-byte (get-u8 port))