mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
upgrade_fw: fw_upgrade_command_handler: fix cmd_size check
body_size is unsigned so the comparison was always false BUG=None BRANCH=none TEST=tested the update process on CR50 board using the usb_updater Change-Id: I004ee94653656449ae6f8699f06422e925d9e1b6 Signed-off-by: Lucian Cojocar <cojocar@google.com> Reviewed-on: https://chromium-review.googlesource.com/362082 Commit-Ready: Dan Shi <dshi@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
3d4c4ffdfa
commit
fac4f79fc5
@@ -102,12 +102,12 @@ void fw_upgrade_command_handler(void *body,
|
||||
*/
|
||||
*response_size = sizeof(*rv);
|
||||
|
||||
body_size = cmd_size - offsetof(struct upgrade_command, block_body);
|
||||
if (body_size < 0) {
|
||||
if (cmd_size < offsetof(struct upgrade_command, block_body)) {
|
||||
CPRINTF("%s:%d\n", __func__, __LINE__);
|
||||
*rv = UPGRADE_GEN_ERROR;
|
||||
return;
|
||||
}
|
||||
body_size = cmd_size - offsetof(struct upgrade_command, block_body);
|
||||
|
||||
if (!cmd_body->block_base && !body_size) {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user