aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/mac/poly1305
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-12-31 14:18:35 +0000
committerlloyd <[email protected]>2014-12-31 14:18:35 +0000
commitd37a40952c0f0940b8b6ddfd245504cad761bf9a (patch)
tree4a1c0447c96d81959bf3e616c2b333f11ece9f7c /src/lib/mac/poly1305
parentc25cd2bf6058d92a09a38c27252cec74158f23e4 (diff)
Fix one past the end write in Poly1305 finish
Diffstat (limited to 'src/lib/mac/poly1305')
-rw-r--r--src/lib/mac/poly1305/poly1305.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/mac/poly1305/poly1305.cpp b/src/lib/mac/poly1305/poly1305.cpp
index 32ab64d7e..11ce0fe41 100644
--- a/src/lib/mac/poly1305/poly1305.cpp
+++ b/src/lib/mac/poly1305/poly1305.cpp
@@ -60,7 +60,7 @@ void Poly1305::final_result(byte out[])
if(m_buf_pos != 0)
{
m_buf[m_buf_pos] = 1;
- clear_mem(&m_buf[m_buf_pos+1], m_buf.size() - m_buf_pos);
+ clear_mem(&m_buf[m_buf_pos+1], m_buf.size() - m_buf_pos - 1);
poly1305_blocks(m_poly, &m_buf[0], 1, true);
}