From d1763df9ed6383235d2a9f599d9ba285ddae26b7 Mon Sep 17 00:00:00 2001 From: Andreas Weigel Date: Mon, 1 Mar 2021 14:17:43 -0500 Subject: [PATCH] lws_struct: fix implicit schema recognition actually use the index to iterate through the map of children to not only match the first ever occurring entry --- lib/misc/lws-struct-lejp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/misc/lws-struct-lejp.c b/lib/misc/lws-struct-lejp.c index 7f3f30461..081b0cef5 100644 --- a/lib/misc/lws-struct-lejp.c +++ b/lib/misc/lws-struct-lejp.c @@ -51,10 +51,10 @@ lws_struct_schema_only_lejp_cb(struct lejp_ctx *ctx, char reason) */ while (n--) { - const lws_struct_map_t *child = map->child_map; int m, child_members = (int)map->child_map_size; for (m = 0; m < child_members; m++) { + const lws_struct_map_t *child = &map->child_map[m]; if (!strcmp(ctx->path, child->colname)) { /* * We matched on him... map is pointing