From 93b4efb36919b2da8a3a2b8a9c79ac45620d83de Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 3 Sep 2004 10:52:59 +0000 Subject: [PATCH] fix WAKE_CFB --- trunk/c5/strciphr.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/trunk/c5/strciphr.h b/trunk/c5/strciphr.h index 4fb1808a..27ca67ee 100644 --- a/trunk/c5/strciphr.h +++ b/trunk/c5/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 {