[master] b3944b63c ws_emu: Missing null check

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Jan 31 16:45:06 UTC 2022


commit b3944b63cfda1ad04bd450dbbcb055b997b09a25
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Jan 31 17:42:53 2022 +0100

    ws_emu: Missing null check
    
    Spotted by Coverity Scan: if we have a reservation, it must be the last
    workspace allocation, so there must be one.

diff --git a/bin/varnishd/cache/cache_ws_emu.c b/bin/varnishd/cache/cache_ws_emu.c
index 22e85870c..830f8c450 100644
--- a/bin/varnishd/cache/cache_ws_emu.c
+++ b/bin/varnishd/cache/cache_ws_emu.c
@@ -529,6 +529,7 @@ WS_Dump(const struct ws *ws, char where, size_t off, void *buf, size_t len)
 	if (where == 'f' && ws->r != NULL) {
 		if (l > len)
 			l = len;
+		AN(wa);
 		memcpy(b, wa->ptr, l);
 		b += l;
 		len -= l;


More information about the varnish-commit mailing list