From ad83510903679a92555187cfc0904d0ff21da9b3 Mon Sep 17 00:00:00 2001 From: Philippe Sultan Date: Mon, 15 Oct 2007 13:51:21 +0000 Subject: [PATCH] Allocate more space for the base64 output we need to generate. Closes issue #10913, reported by tootai, who graciously granted us access to his Asterisk server, thanks! Daniel, feel free to reopen the bug in case you can reproduce this on 1.4. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85551 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_jabber.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/res/res_jabber.c b/res/res_jabber.c index 58d8e7cbc7..f93c8617f4 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -561,10 +561,10 @@ static int aji_start_sasl(iksparser *prs, enum ikssasltype type, char *username, iks_insert_attrib(x, "xmlns", IKS_NS_XMPP_SASL); len = strlen(username) + strlen(pass) + 3; s = alloca(len); - base64 = alloca((len + 1) * 4 / 3); + base64 = alloca((len + 2) * 4 / 3); iks_insert_attrib(x, "mechanism", "PLAIN"); snprintf(s, len, "%c%s%c%s", 0, username, 0, pass); - ast_base64encode(base64, (const unsigned char *) s, len, (len + 1) * 4 / 3); + ast_base64encode(base64, (const unsigned char *) s, len, (len + 2) * 4 / 3); iks_insert_cdata(x, base64, 0); iks_send(prs, x); iks_delete(x);