Skip to content

Commit e6456ee

Browse files
Mads Bligaard NielsenMads Bligaard Nielsen
authored andcommitted
boot: serial: unable to detect cbor encode overrun (wrong buf-size)
* reset_cbor_state() used buffer-end-address as buffer length (payload_len)
1 parent 6c0480f commit e6456ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

boot/boot_serial/src/boot_serial.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static zcbor_state_t cbor_state[2];
125125
void reset_cbor_state(void)
126126
{
127127
zcbor_new_encode_state(cbor_state, 2, (uint8_t *)bs_obuf,
128-
(size_t)bs_obuf + sizeof(bs_obuf), 0);
128+
sizeof(bs_obuf), 0);
129129
}
130130

131131
/**

0 commit comments

Comments
 (0)