diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-15 12:48:10 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-15 12:48:10 +0000 |
commit | a6f1dc000a8ccd3a09cf0bde7f13742f1e18c554 (patch) | |
tree | b217901a52bc09f3e5172f6a12f2f41b540bdc24 /main/utils.c | |
parent | 062af3bf382a8c11deef4e7f1d44dbd134c63918 (diff) |
Make sure that the base64 decoder returns a terminated string.
(closes issue #10979)
Reported by: ys
Patches:
util.c.diff uploaded by ys (license 281)
- small mods by me
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@85543 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/utils.c')
-rw-r--r-- | main/utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/main/utils.c b/main/utils.c index 61fb8a194..5d4bd1cdc 100644 --- a/main/utils.c +++ b/main/utils.c @@ -347,6 +347,9 @@ int ast_base64decode(unsigned char *dst, const char *src, int max) cnt++; } } + if (cnt == max) + dst--; + *dst = '\0'; /* Dont worry about left over bits, they're extra anyway */ return cnt; } |