[master] 3e0717e51 http: Don't alias range lo and hi fallbacks

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Jan 18 06:44:05 UTC 2023


commit 3e0717e51d46b2338d5791ffcf4d605996f3c2a0
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Wed Oct 26 14:34:20 2022 +0200

    http: Don't alias range lo and hi fallbacks

diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index 0a8186861..77120bf3f 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -960,15 +960,15 @@ http_GetContentRange(const struct http *hp, ssize_t *lo, ssize_t *hi)
 const char *
 http_GetRange(const struct http *hp, ssize_t *lo, ssize_t *hi)
 {
-	ssize_t tmp;
+	ssize_t tmp_lo, tmp_hi;
 	const char *b, *t;
 
 	CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
 
 	if (lo == NULL)
-		lo = &tmp;
+		lo = &tmp_lo;
 	if (hi == NULL)
-		hi = &tmp;
+		hi = &tmp_hi;
 
 	*lo = *hi = -1;
 


More information about the varnish-commit mailing list