diff options
author | faqiang.zhu <faqiang.zhu@nxp.com> | 2019-04-18 10:51:28 +0800 |
---|---|---|
committer | faqiang.zhu <faqiang.zhu@nxp.com> | 2019-04-18 11:47:29 +0800 |
commit | 0082e528174ff71704bf8558c2f1d127096429f4 (patch) | |
tree | e42349b3f6ae9a42f28cb99f093003db08bd34ed /lib | |
parent | 999d2f2504cc45f290b0b685c004f2b8e21eb607 (diff) |
MA-14629 fix build warnings for varialbe initialization and type cast
initialize potential uninitialized variable with the type of"char*" to
be NULL in AVB. That "hashtree_error_mode" in code is manually specified
with a known value, the cases listed cover all potential value of
"hashtree_error_mode"
explicitly do a type cast for memcpy parameters.
Change-Id: Ie5d234422a273d6dab75585bd0d8eb81583707ca
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/avb/libavb/avb_cmdline.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/avb/libavb/avb_cmdline.c b/lib/avb/libavb/avb_cmdline.c index 3f4b99ace9..ce331597ae 100644 --- a/lib/avb/libavb/avb_cmdline.c +++ b/lib/avb/libavb/avb_cmdline.c @@ -222,7 +222,7 @@ AvbSlotVerifyResult avb_append_options( AvbAlgorithmType algorithm_type, AvbHashtreeErrorMode hashtree_error_mode) { AvbSlotVerifyResult ret; - const char* verity_mode; + const char* verity_mode = NULL; bool is_device_unlocked; AvbIOResult io_ret; @@ -320,7 +320,7 @@ AvbSlotVerifyResult avb_append_options( if (toplevel_vbmeta->flags & AVB_VBMETA_IMAGE_FLAGS_HASHTREE_DISABLED) { verity_mode = "disabled"; } else { - const char* dm_verity_mode; + const char* dm_verity_mode = NULL; char* new_ret; switch (hashtree_error_mode) { |