Coverity 652910 Uninitialized pointer read
Heinrich Schuchardt <[email protected]>
| Newsgroups | gmane.comp.boot-loaders.u-boot.general,gmane.comp.boot-loaders.u-boot |
|---|---|
| Message-ID | <[email protected]> |
Hello Igor,
Covertiy complains that avb_replace() might be called with and
uninitialzed value of dm_verity_mode.
I think to fix the issue following change is needed:
$ git diff
diff --git a/lib/libavb/avb_cmdline.c b/lib/libavb/avb_cmdline.c
index 842629abe0e..f2d2e350d6b 100644
--- a/lib/libavb/avb_cmdline.c
+++ b/lib/libavb/avb_cmdline.c
@@ -333,7 +333,7 @@ AvbSlotVerifyResult avb_append_options(
// Should never get here because MANAGED_RESTART_AND_EIO is
// remapped by avb_manage_hashtree_error_mode().
avb_assert_not_reached();
- break;
+ return AVB_SLOT_VERIFY_RESULT_ERROR_IO;
case AVB_HASHTREE_ERROR_MODE_PANIC:
verity_mode = "panicking";
dm_verity_mode = "panic_on_corruption";
Do you know where the upstream code lives that we copied?
Probably we want to fix upstream first.
Best regards
Heinrich