diff options
author | mnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-06 16:26:59 +0000 |
---|---|---|
committer | mnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-06 16:26:59 +0000 |
commit | 1681d71ab4dc96b899b026da21a2e7b3bd061a65 (patch) | |
tree | ba37194407ec3f324c0bec70dac6bfb41e8e0bc7 /main | |
parent | 10a2d6e06c07648d0f2881ec501b31918bcc0828 (diff) |
Properly handle '=' while decoding base64 messages and null terminate strings returned from BASE64_DECODE.
(closes issue #15271)
Reported by: chappell
Patches:
base64_fix.patch uploaded by chappell (license 8)
Tested by: kobaz
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@228378 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/utils.c b/main/utils.c index ff8b36928..97991efe1 100644 --- a/main/utils.c +++ b/main/utils.c @@ -269,7 +269,7 @@ int ast_base64decode(unsigned char *dst, const char *src, int max) unsigned int byte = 0; unsigned int bits = 0; int incnt = 0; - while(*src && (cnt < max)) { + while(*src && *src != '=' && (cnt < max)) { /* Shift in 6 bits of input */ byte <<= 6; byte |= (b2a[(int)(*src)]) & 0x3f; |