summaryrefslogtreecommitdiff
path: root/res/res_jabber.c
diff options
context:
space:
mode:
authorPhilippe Sultan <philippe.sultan@gmail.com>2007-10-15 13:51:21 +0000
committerPhilippe Sultan <philippe.sultan@gmail.com>2007-10-15 13:51:21 +0000
commitad83510903679a92555187cfc0904d0ff21da9b3 (patch)
tree16cd1c13fbbbc6cee9d3fc087cc058a5f57b3803 /res/res_jabber.c
parentc2ba92b385cecf90c5491a4bd9a896ea4fd2f441 (diff)
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
Diffstat (limited to 'res/res_jabber.c')
-rw-r--r--res/res_jabber.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c
index 58d8e7cbc..f93c8617f 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);