Browse files

fix state update problem for digests

We need to update the amount of data in the buffer even after we've
consumed all the data.  Otherwise, we can run into a situation where we
had N bytes buffered and update with (blocksize - N) + blocksize bytes;
we consume all the buffered data and the provided data and there's
nothing left in the buffer.  Fixes problems introduced in
  • Loading branch information...
froydnj committed Jun 26, 2012
1 parent 8fd2eaf commit b67b0218d9f1169e8bd88b4a48da8346fd77f9f5
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/digests/digest.lisp
@@ -239,8 +239,8 @@
finally (return
(let ((amount (- end start)))
(unless (zerop amount)
- (copy-to-buffer seq start amount buffer 0)
- (setf (mdx-buffer-index state) amount))
+ (copy-to-buffer seq start amount buffer 0))
+ (setf (mdx-buffer-index state) amount)
(incf (mdx-amount state) length)
(declaim (notinline mdx-updater))

0 comments on commit b67b021

Please sign in to comment.