[master] 3648ab627 Missing null check

Dridi Boukelmoune dridi at varni.sh
Tue Apr 30 08:16:51 UTC 2019


On Tue, Apr 30, 2019 at 10:03 AM Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
>
> --------
> In message <20190430075607.E3704AF893 at lists.varnish-cache.org>, Dridi Boukelmou
> ne writes:
>
> That is actually not what Coverity complained about, but I had already
> added the missing AN(body) before we got the report.

Technically it was, REPLACE() already does a null check after strdup()
so the only case was a null argument.

I didn't notice the AN(body) but I can revert this commit.


> >    Missing null check
> >
> >    Spotted by Coverity Scan.
> >
> >diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
> >index 41baa8803..42006ef3d 100644
> >--- a/bin/varnishtest/vtc_http2.c
> >+++ b/bin/varnishtest/vtc_http2.c
> >@@ -1518,6 +1518,7 @@ cmd_tx11obj(CMD_ARGS)
> >               else if (CMD_IS("txreq") || CMD_IS("txresp")) {
> >                       if (AV_IS("-body")) {
> >                               AZ(body);
> >+                              AN(av[1]);
> >                               REPLACE(body, av[1]);
> >                               AN(body);
> >                               bodylen = strlen(body);
>
>
> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit


More information about the varnish-commit mailing list