From 2e4e19f7ac6f6a2391932400b5de764a7283227a Mon Sep 17 00:00:00 2001 From: Jeff Connelly Date: Thu, 15 May 2008 12:48:01 -0700 Subject: [PATCH] Fix off-by-one error in null termination of decrypted messages. --- libotp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libotp.c b/libotp.c index 728c038..2db7ed6 100644 --- a/libotp.c +++ b/libotp.c @@ -416,7 +416,7 @@ char *otp_decrypt_msg(MESSAGE *msg) /* Null-terminate output for convenience when using text-only messages. * The output is still of length msg->length; use msg->length when decrypting * binary messages. */ - out[msg->length + 1] = 0; + out[msg->length] = 0; free(pad_data); -- 2.11.4.GIT