diff options
author | phsultan <phsultan@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-15 13:51:21 +0000 |
---|---|---|
committer | phsultan <phsultan@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-15 13:51:21 +0000 |
commit | ac2e2161334ea33d145dbfe29327073a88cf2b0c (patch) | |
tree | 16cd1c13fbbbc6cee9d3fc087cc058a5f57b3803 /res/res_jabber.c | |
parent | cf06867b6810054bec857339e1e1318f56eed3eb (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: http://svn.digium.com/svn/asterisk/trunk@85551 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_jabber.c')
-rw-r--r-- | res/res_jabber.c | 4 |
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); |