From 8c122cd8bd5123e7def1e2602f1031fa93fc2c16 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 22 Jun 2021 14:56:36 +0100 Subject: [PATCH] redirect: make sure we start with / on path --- lib/core-net/client/connect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core-net/client/connect.c b/lib/core-net/client/connect.c index 2298fa21b..18863f63e 100644 --- a/lib/core-net/client/connect.c +++ b/lib/core-net/client/connect.c @@ -88,7 +88,7 @@ lws_client_stash_create(struct lws *wsi, const char **cisin) char *pc; int n; - size = sizeof(*wsi->stash); + size = sizeof(*wsi->stash) + 1; /* * Let's overallocate the stash object with space for all the args @@ -114,6 +114,8 @@ lws_client_stash_create(struct lws *wsi, const char **cisin) if (cisin[n]) { size_t mm; wsi->stash->cis[n] = pc; + if (n == CIS_PATH && cisin[n][0] != '/') + *pc++ = '/'; mm = strlen(cisin[n]) + 1; memcpy(pc, cisin[n], mm); pc += mm;