diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-25 17:48:34 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-25 17:48:34 +0000 |
commit | ce7f125edd4ab3f89a3cade00a8fd60ebfcc6ec1 (patch) | |
tree | ed1bab1020dcec107625dff1a740a83e5a891a4b /main/utils.c | |
parent | cd817e2338768f1a422bbd34d207766c94a94d36 (diff) |
Off by one error in buffer length (issue 7379)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41103 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/utils.c')
-rw-r--r-- | main/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/utils.c b/main/utils.c index 0aaa791a5..feb4a621f 100644 --- a/main/utils.c +++ b/main/utils.c @@ -363,7 +363,7 @@ int ast_base64encode_full(char *dst, const unsigned char *src, int srclen, int m byte |= *(src++); bits += 8; cntin++; - if ((bits == 24) && (cnt + 4 < max)) { + if ((bits == 24) && (cnt + 4 <= max)) { *dst++ = base64[(byte >> 18) & 0x3f]; *dst++ = base64[(byte >> 12) & 0x3f]; *dst++ = base64[(byte >> 6) & 0x3f]; @@ -379,7 +379,7 @@ int ast_base64encode_full(char *dst, const unsigned char *src, int srclen, int m col = 0; } } - if (bits && (cnt + 4 < max)) { + if (bits && (cnt + 4 <= max)) { /* Add one last character for the remaining bits, padding the rest with 0 */ byte <<= 24 - bits; |