diff options
| author | Andrew Goodbody <[email protected]> | 2025-06-26 17:38:54 +0100 |
|---|---|---|
| committer | Mattijs Korpershoek <[email protected]> | 2025-07-02 12:10:04 +0200 |
| commit | 4b9717c6868f2f98b02fbe87a885cfa48a5b9946 (patch) | |
| tree | fcf678acb7e7580de113df11410fa50da3957bc0 /cmd | |
| parent | a6732920821a23e00cc3291d8069061bd7d00e67 (diff) | |
cmd: abootimg: Prevent use of unintialised variable
Initialise vhdr to prevent its use when uninitialised.
This issue was found with Smatch.
Fixes: 636da2039aea (android: boot: support boot image header version 3 and 4)
Signed-off-by: Andrew Goodbody <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[mkorpershoek: fixed trivial typo in commit msg]
Signed-off-by: Mattijs Korpershoek <[email protected]>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/abootimg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/abootimg.c b/cmd/abootimg.c index 44de00fb9c9..6fb52153786 100644 --- a/cmd/abootimg.c +++ b/cmd/abootimg.c @@ -96,7 +96,7 @@ static int abootimg_get_dtb_load_addr(int argc, char *const argv[]) return CMD_RET_USAGE; struct andr_image_data img_data = {0}; const struct andr_boot_img_hdr_v0 *hdr; - const struct andr_vnd_boot_img_hdr *vhdr; + const struct andr_vnd_boot_img_hdr *vhdr = NULL; hdr = map_sysmem(abootimg_addr(), sizeof(*hdr)); if (get_avendor_bootimg_addr() != -1) |
