From 9dd324aab23d8540260c8da93ae3927854542ecb Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Thu, 5 Sep 2013 15:18:42 +0200 Subject: [PATCH] z85 encoding buffer overrun --- tests/test_security_curve.cpp | 2 +- tools/curve_keygen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_security_curve.cpp b/tests/test_security_curve.cpp index 6f6f829b..ce9f1800 100644 --- a/tests/test_security_curve.cpp +++ b/tests/test_security_curve.cpp @@ -53,7 +53,7 @@ static void zap_handler (void *ctx) int size = zmq_recv (zap, client_key, 32, 0); assert (size == 32); - char client_key_text [40]; + char client_key_text [41]; Z85_encode (client_key_text, client_key, 32); assert (streq (version, "1.0")); diff --git a/tools/curve_keygen.c b/tools/curve_keygen.c index 157d6fb2..621d1d84 100644 --- a/tools/curve_keygen.c +++ b/tools/curve_keygen.c @@ -56,7 +56,7 @@ int main (void) int rc = crypto_box_keypair (public_key, secret_key); assert (rc == 0); - char encoded [40]; + char encoded [41]; Z85_encode (encoded, public_key, 32); puts ("\n== CURVE PUBLIC KEY =="); puts (encoded);