mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user