[master] 5e5b442f5 VSLb() is not the choice for a single string argument

Nils Goroll nils.goroll at uplex.de
Wed Jul 20 15:29:06 UTC 2022


commit 5e5b442f53d27cfa6000f9bc7694fbce5a46af5c
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Jul 20 17:24:46 2022 +0200

    VSLb() is not the choice for a single string argument
    
    spotted by gcc 9.4.0:
    
            error: format not a string literal and no format arguments
            [-Werror=format-security]

diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index be3d56768..312ca0d01 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -976,7 +976,7 @@ VRT_CacheReqBody(VRT_CTX, VCL_BYTES maxsize)
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	if (ctx->method != VCL_MET_RECV) {
 		if (ctx->vsl != NULL) {
-			VSLb(ctx->vsl, SLT_VCL_Error, err);
+			VSLbs(ctx->vsl, SLT_VCL_Error, TOSTRAND(err));
 		} else {
 			AN(ctx->msg);
 			VSB_printf(ctx->msg, "%s\n", err);


More information about the varnish-commit mailing list