diff --git a/Garlic.cpp b/Garlic.cpp index df7bb1dc..f1768611 100644 --- a/Garlic.cpp +++ b/Garlic.cpp @@ -348,7 +348,7 @@ namespace garlic buf += 2; if (tagCount > 0) { - decryption->SetTagCount (tagCount); + decryption->AddTagCount (tagCount); for (int i = 0; i < tagCount; i++) m_SessionTags[SessionTag(buf + i*32)] = decryption; } diff --git a/Garlic.h b/Garlic.h index f2c08fb4..98df8f6f 100644 --- a/Garlic.h +++ b/Garlic.h @@ -80,7 +80,8 @@ namespace garlic public: SessionDecryption (): m_TagCount (0) {}; - void SetTagCount (int tagCount) { m_TagCount = tagCount; }; + void SetTagCount (int tagCount) { m_TagCount = tagCount; }; + void AddTagCount (int tagCount) { m_TagCount += tagCount; }; int GetTagCount () const { return m_TagCount; }; bool UseTag () { m_TagCount--; return m_TagCount > 0; };