From 71e4b4118ec10cb7fe9049da133d84395eec4210 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 30 Apr 2020 20:26:19 +0100 Subject: [PATCH] strexp: reset out offset each time A second strexp mustn't inherit the offset of the first, completed one --- lib/core/libwebsockets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/core/libwebsockets.c b/lib/core/libwebsockets.c index 8453ac037..e92832859 100644 --- a/lib/core/libwebsockets.c +++ b/lib/core/libwebsockets.c @@ -947,6 +947,7 @@ lws_strexp_expand(lws_strexp_t *exp, const char *in, size_t len, if (*in == '{') { exp->state = LWS_EXPS_NAME_OR_CLOSE; exp->name_pos = 0; + exp->exp_ofs = 0; break; } /* treat as a literal */