[6.0] 4a607fe33 VMOD blob encoder: don't forget the terminating null byte

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Aug 16 08:53:20 UTC 2018


commit 4a607fe33abaca1efeb800fd309cee18202f1d28
Author: Geoff Simmons <geoff at uplex.de>
Date:   Wed Jul 18 16:33:39 2018 +0200

    VMOD blob encoder: don't forget the terminating null byte

diff --git a/lib/libvmod_blob/vmod_blob.c b/lib/libvmod_blob/vmod_blob.c
index 87591fb52..632580e91 100644
--- a/lib/libvmod_blob/vmod_blob.c
+++ b/lib/libvmod_blob/vmod_blob.c
@@ -431,6 +431,7 @@ encode(VRT_CTX, enum encoding enc, enum case_e kase, VCL_BLOB b)
 		WS_Reset(ctx->ws, snap);
 		return "";
 	}
+	buf[len] = '\0';
 	WS_Release(ctx->ws, len + 1);
 	return buf;
 }


More information about the varnish-commit mailing list