From 42b2f932d2c3e5ed06f4ccd7119d8c74507f7690 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Mon, 15 Oct 2007 12:49:31 +0000 Subject: Merged revisions 85543 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85543 | russell | 2007-10-15 07:48:10 -0500 (Mon, 15 Oct 2007) | 8 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@85544 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/utils.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main/utils.c') diff --git a/main/utils.c b/main/utils.c index a4b0a4557..80fadfdcc 100644 --- a/main/utils.c +++ b/main/utils.c @@ -352,6 +352,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; } -- cgit v1.2.3