From 7c9cf28012f65ce6a67651030b817d7d45eda62b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 25 Oct 2011 15:11:32 +0000 Subject: Fixed bug in base64 decoding. If an attempt is made to read data after the end of the stream has been reached, and the input didn't end with '=' chars then it would return the final buffer an extra time before ending. Now it ends when it should, no matter how many extra times you try to read. --- src/base64.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/base64.cpp') diff --git a/src/base64.cpp b/src/base64.cpp index 18a18e5..04ca009 100644 --- a/src/base64.cpp +++ b/src/base64.cpp @@ -118,6 +118,8 @@ Bu::size Bu::Base64::read( void *pBuf, Bu::size nBytes ) { if( rNext.isEos() ) { + if( iRPos == 0 ) + iRPos = iChars; bEosIn = true; if( j != 0 ) { -- cgit v1.2.3