From: Teemu Kalvas Date: Wed, 8 Feb 2006 19:41:10 +0000 (+0000) Subject: Fixed buffer overrun in resync restart for variable width external formats. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=118902aab241d73ac48a40b3fef4101f654d9ec0;p=sbcl.git Fixed buffer overrun in resync restart for variable width external formats. --- diff --git a/src/code/fd-stream.lisp b/src/code/fd-stream.lisp index 1afdecf..a84133e 100644 --- a/src/code/fd-stream.lisp +++ b/src/code/fd-stream.lisp @@ -1259,14 +1259,17 @@ (let ((byte (sap-ref-8 sap head))) ,in-expr)) (defun ,resync-function (stream) - (loop (input-at-least stream 1) + (loop (input-at-least stream 2) (incf (fd-stream-ibuf-head stream)) (unless (block decode-break-reason (let* ((sap (fd-stream-ibuf-sap stream)) (head (fd-stream-ibuf-head stream)) (byte (sap-ref-8 sap head)) (size ,in-size-expr)) - ,in-expr) + (input-at-least stream size) + (let ((sap (fd-stream-ibuf-sap stream)) + (head (fd-stream-ibuf-head stream))) + ,in-expr)) nil) (return)))) (setf *external-formats*