author | Tianjie Xu <xunchang@google.com> | |
Wed, 28 Feb 2018 01:05:39 +0000 (17:05 -0800) | ||
committer | Tianjie Xu <xunchang@google.com> | |
Wed, 28 Feb 2018 07:04:14 +0000 (23:04 -0800) | ||
commit | c2420845391bb8b50cb782c5fee95f0fa643e49c | |
tree | 22de4e9ea21430376e40560b2db9057a040e3335 | tree | snapshot (tar.xz tar.gz zip) |
parent | bf52b7e00b63397d9c81b7f7ffa7a8b8799edd4a | commit | diff |
Fix the behavior of undefined commands in BlockImageVerify
In BlockImageVerify some commands are undefined, e.g. "erase", "new",
"zero". And we should not error out if the corresponding function
pointer of these commands is null; otherwise we will fail the
verification.
The old code is:
if (cmd->f != nullptr && cmd->f(params) == -1)
return false;
In the last_command_file change the logic was wrongly modified to
if (cmd->f == nullptr)
return false;
...
if (cmd->f(params) == -1)
return false;
Test: sideload an incremental OTA twice on bullhead
Change-Id: I2561c365badb850da0e416629ccd61f0df7da5d7
In BlockImageVerify some commands are undefined, e.g. "erase", "new",
"zero". And we should not error out if the corresponding function
pointer of these commands is null; otherwise we will fail the
verification.
The old code is:
if (cmd->f != nullptr && cmd->f(params) == -1)
return false;
In the last_command_file change the logic was wrongly modified to
if (cmd->f == nullptr)
return false;
...
if (cmd->f(params) == -1)
return false;
Test: sideload an incremental OTA twice on bullhead
Change-Id: I2561c365badb850da0e416629ccd61f0df7da5d7
updater/blockimg.cpp | diff | blob | history |