Avoid "format not a string literal and no format arguments"

In file included from vmod_file.c:44:
vmod_file.c: In function ‘check’:
/usr/include/varnish/cache/cache.h:66:26: error: format not a string literal and no format arguments [-Werror=format-security]
   66 | #define NO_VXID ((struct vxids){0})
      |                          ^~~~~
vmod_file.c:171:32: note: in expansion of macro ‘NO_VXID’
  171 |                 VSL(SLT_Error, NO_VXID, errbuf);
      |                                ^~~~~~~
      ...
parent abc75cb4
......@@ -173,7 +173,7 @@ check(union sigval val)
}
VERRMSG(rdr, errbuf, "%s.%s: cannot open %s: %s", rdr->vcl_name,
rdr->obj_name, info->path, VAS_errtxt(errno));
VSL(SLT_Error, NO_VXID, errbuf);
VSL(SLT_Error, NO_VXID, "%s", errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -184,7 +184,7 @@ check(union sigval val)
VERRMSG(rdr, errbuf, "%s.%s: cannot read info about %s: %s",
rdr->vcl_name, rdr->obj_name, info->path,
VAS_errtxt(errno));
VSL(SLT_Error, NO_VXID, errbuf);
VSL(SLT_Error, NO_VXID, "%s", errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -192,7 +192,7 @@ check(union sigval val)
if (!S_ISREG(st.st_mode)) {
VERRMSG(rdr, errbuf, "%s.%s: %s is not a regular file",
rdr->vcl_name, rdr->obj_name, info->path);
VSL(SLT_Error, NO_VXID, errbuf);
VSL(SLT_Error, NO_VXID, "%s", errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -225,7 +225,7 @@ check(union sigval val)
VERRMSG(rdr, errbuf, "%s.%s: could not map %s: %s",
rdr->vcl_name, rdr->obj_name, info->path,
VAS_errtxt(errno));
VSL(SLT_Error, NO_VXID, errbuf);
VSL(SLT_Error, NO_VXID, "%s", errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -235,7 +235,7 @@ check(union sigval val)
!= 0) {
VERRMSG(rdr, errbuf, "%s.%s: madvise(SEQUENTIAL): %s",
rdr->vcl_name, rdr->obj_name, VAS_errtxt(err));
VSL(SLT_Error, NO_VXID, errbuf);
VSL(SLT_Error, NO_VXID, "%s", errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -243,7 +243,7 @@ check(union sigval val)
!= 0) {
VERRMSG(rdr, errbuf, "%s.%s: madvise(WILLNEED): %s",
rdr->vcl_name, rdr->obj_name, VAS_errtxt(err));
VSL(SLT_Error, NO_VXID, errbuf);
VSL(SLT_Error, NO_VXID, "%s", errbuf);
flags |= RDR_ERROR;
goto out;
}
......@@ -277,7 +277,7 @@ check(union sigval val)
VERRMSG(rdr, errbuf, "%s.%s: unmap failed: %s",
rdr->vcl_name, rdr->obj_name,
VAS_errtxt(errno));
VSL(SLT_Error, NO_VXID, errbuf);
VSL(SLT_Error, NO_VXID, "%s", errbuf);
flags |= RDR_ERROR;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment