Bluetooth: Mesh: Avoid undefined behavior in bit shift in blob_cli.c
block_size_log can be 0x20 which will shift 1 by 32 bits which will cause undefined behavior. Adding ULL to 1 is an option but this will add little bit more code when debug option is enabled. So simply print the logarithmic value. Coverity-ID: 316387 Fixes #58951 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit is contained in:
parent
cfd368fef1
commit
242c8f1c77
1 changed files with 2 additions and 2 deletions
|
@ -1550,9 +1550,9 @@ int bt_mesh_blob_cli_send(struct bt_mesh_blob_cli *cli,
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
LOG_DBG("\n\tblock size: %u\n\tchunk size: %u\n"
|
||||
LOG_DBG("\n\tblock size log: %u\n\tchunk size: %u\n"
|
||||
"\tblob size: %u\n\tmode: %x",
|
||||
(1 << cli->xfer->block_size_log), cli->xfer->chunk_size,
|
||||
cli->xfer->block_size_log, cli->xfer->chunk_size,
|
||||
cli->xfer->size, cli->xfer->mode);
|
||||
|
||||
return xfer_start(cli);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue