From bf7ce9baa84e06a5bf001e55db1111c1050e2cfc Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 3 Sep 2004 10:52:59 +0000 Subject: fix WAKE_CFB git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@192 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- strciphr.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'strciphr.h') diff --git a/strciphr.h b/strciphr.h index 4fb1808..27ca67e 100644 --- a/strciphr.h +++ b/strciphr.h @@ -189,11 +189,16 @@ struct CRYPTOPP_NO_VTABLE CFB_CipherConcretePolicy : public BASE if (m_dir == ENCRYPTION) { - WordType ct = *(const WordType *)m_input ^ registerWord; - registerWord = ct; - *(WordType*)m_output = ct; - m_input += sizeof(WordType); - m_output += sizeof(WordType); + if (m_input == NULL) + assert(m_output == NULL); + else + { + WordType ct = *(const WordType *)m_input ^ registerWord; + registerWord = ct; + *(WordType*)m_output = ct; + m_input += sizeof(WordType); + m_output += sizeof(WordType); + } } else { -- cgit v1.2.1