mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-02 02:18:31 +00:00
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/branches/1.4@85543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -347,6 +347,9 @@ int ast_base64decode(unsigned char *dst, const char *src, int max)
|
|||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (cnt == max)
|
||||||
|
dst--;
|
||||||
|
*dst = '\0';
|
||||||
/* Dont worry about left over bits, they're extra anyway */
|
/* Dont worry about left over bits, they're extra anyway */
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user