From ef574b2101458d3af6b4c1453a7b5edadf001b66 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 5 Oct 2021 16:19:31 +0200 Subject: [PATCH] BUG/MINOR: httpclient/lua: does not process headers when failed Do not try to process the header list when it is NULL. This case can arrive when the request failed and did not return a response. --- src/hlua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hlua.c b/src/hlua.c index 5bb0535320..9589473a73 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -6988,7 +6988,7 @@ __LJMP static int hlua_httpclient_get_headers(lua_State *L, struct hlua_httpclie lua_newtable(L); - for (hdr = hlua_hc->hc->res.hdrs; isttest(hdr->n); hdr++) { + for (hdr = hlua_hc->hc->res.hdrs; hdr && isttest(hdr->n); hdr++) { struct ist n, v; int len;