[master] 02ada45c5 ws_emu: Remove unused variable

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Sep 22 16:37:05 UTC 2021


commit 02ada45c5d5119c0f86a6db24fffd696e0feb626
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Wed Sep 22 18:35:15 2021 +0200

    ws_emu: Remove unused variable
    
    Spotted by oss-fuzz.

diff --git a/bin/varnishd/cache/cache_ws_emu.c b/bin/varnishd/cache/cache_ws_emu.c
index 95cb80800..43ee87f85 100644
--- a/bin/varnishd/cache/cache_ws_emu.c
+++ b/bin/varnishd/cache/cache_ws_emu.c
@@ -493,7 +493,7 @@ WS_Dump(const struct ws *ws, char where, size_t off, void *buf, size_t len)
 {
 	struct ws_emu *we;
 	struct ws_alloc *wa;
-	unsigned l, r;
+	unsigned l;
 	char *b;
 
 	WS_Assert(ws);
@@ -526,13 +526,11 @@ WS_Dump(const struct ws *ws, char where, size_t off, void *buf, size_t len)
 	}
 
 	b = buf;
-	r = 0;
 	if (where == 'f' && ws->r != NULL) {
 		if (l > len)
 			l = len;
 		memcpy(b, wa->ptr, l);
 		b += l;
-		r += l;
 		len -= l;
 	}
 
@@ -547,7 +545,6 @@ WS_Dump(const struct ws *ws, char where, size_t off, void *buf, size_t len)
 				l = len;
 			memcpy(b, wa->ptr, l);
 			b += l;
-			r += l;
 			len -= l;
 		}
 	}


More information about the varnish-commit mailing list