phroxy

Gopher to HTTP proxy
git clone git://git.z3bra.org/phroxy.git
Log | Files | Refs | LICENSE

commit bcdad97311b53db4557ec5bc06dd8ffce852610e
parent 0823bcb34e01b1e391207e2b2aaffd61ed763c24
Author: Willy Goiffon <dev@z3bra.org>
Date:   Tue, 15 Sep 2020 11:35:48 +0200

Allocate one more byte for terminating null byte in *body

Diffstat:
Mphroxy.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/phroxy.c b/phroxy.c @@ -275,9 +275,10 @@ htmlize(char *data, size_t *bodysize) } alen = strnlen(a, sizeof(a)); - body = realloc(body, blen + alen); + body = realloc(body, blen + alen + 1); memcpy(body + blen, a, alen); blen += alen; + body[blen] = '\0'; } if (bodysize)