summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/http.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2004-08-07 20:23:50 +0000
committerdes <des@FreeBSD.org>2004-08-07 20:23:50 +0000
commit4fb65f044c1a6bf9179c3c8566db6f316f4033f9 (patch)
tree131fa6941d74d8003c6ba723d27bab0be689eafe /lib/libfetch/http.c
parentc6a109c23068973c4f6e541b901282ff9da789bd (diff)
downloadFreeBSD-src-4fb65f044c1a6bf9179c3c8566db6f316f4033f9.zip
FreeBSD-src-4fb65f044c1a6bf9179c3c8566db6f316f4033f9.tar.gz
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
Diffstat (limited to 'lib/libfetch/http.c')
-rw-r--r--lib/libfetch/http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 8d2f971..1d723d1 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -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;
OpenPOWER on IntegriCloud