From 610b04fa97bfb6e200e21fc5952920def983aeed Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 6 Jun 2022 18:04:06 +0900 Subject: [PATCH] webclient: Clear WGET_FLAG_GOT_CONTENT_LENGTH for each request Otherwise, a stale value might be used after a redirection. --- netutils/webclient/webclient.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netutils/webclient/webclient.c b/netutils/webclient/webclient.c index e3763265a..4dc673021 100644 --- a/netutils/webclient/webclient.c +++ b/netutils/webclient/webclient.c @@ -577,7 +577,8 @@ static inline int wget_parsestatus(struct webclient_context *ctx, */ ws->state = WEBCLIENT_STATE_HEADERS; - ws->internal_flags &= ~(WGET_FLAG_CHUNKED | + ws->internal_flags &= ~(WGET_FLAG_GOT_CONTENT_LENGTH | + WGET_FLAG_CHUNKED | WGET_FLAG_GOT_LOCATION); ndx = 0; break;