From a9ce4c2312d95d29a9417a35c782165c1b6efec5 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Wed, 28 Jun 2023 12:09:19 +0200 Subject: [PATCH] boot_serial: fix misuse of 'matched' param from zcbor_map_decode_bulk() The 'matched' param in zcbor_map_decode_bulk() function is 'pointer to the counter of matched keys', not length of payload buffer. Fixes: fac2cabe98d8 ("boot_serial: Add image state set/get") Signed-off-by: Piotr Dymacz --- boot/boot_serial/src/boot_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/boot_serial/src/boot_serial.c b/boot/boot_serial/src/boot_serial.c index b99375185..503b1f5b5 100644 --- a/boot/boot_serial/src/boot_serial.c +++ b/boot/boot_serial/src/boot_serial.c @@ -440,7 +440,7 @@ bs_set(char *buf, int len) ok = zcbor_map_decode_bulk(zsd, image_set_state_decode, ARRAY_SIZE(image_set_state_decode), &decoded) == 0; - if (!ok || len != decoded) { + if (!ok) { rc = MGMT_ERR_EINVAL; goto out; }