Don't forget to allocate space for the terminating NUL when converting to

base 64.

PR:		misc/70022
Submitted by:	Herve Masson <herve-bsdbt@mindstep.com>
MFC after:	3 days
This commit is contained in:
des 2004-08-07 20:23:50 +00:00
parent c6a109c230
commit 4fb65f044c

View File

@ -566,7 +566,7 @@ _http_base64(const char *src)
int t, r;
l = strlen(src);
if ((str = malloc(((l + 2) / 3) * 4)) == NULL)
if ((str = malloc(((l + 2) / 3) * 4 + 1)) == NULL)
return (NULL);
dst = str;
r = 0;