Skip to content

Commit 8a0d208

Browse files
kareem-wolfssldanielinux
authored andcommitted
Clarify that wolfBoot_open_image_address expects the passed in img structure to be memset and does not perform the memset itself.
1 parent 3d5499f commit 8a0d208

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

docs/lib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ is initialized when `wolfBoot_open_image_address()` is called. The signature is:
1515
`int wolfBoot_open_image_address(struct wolfBoot_image* img, uint8_t* image)`
1616

1717

18-
where `img` is a pointer to a local (uninitialized) structure of type `wolfBoot_image`, and
18+
where `img` is a pointer to a local (memset but otherwise uninitalized) structure of type `wolfBoot_image`, and
1919
`image` is a pointer to where the signed image is mapped in memory, starting from the beginning
2020
of the manifest header.
2121

src/image.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,9 @@ uint32_t wolfBoot_image_size(uint8_t *image)
12701270
*
12711271
* This function opens an image using the provided image address and initializes
12721272
* the wolfBoot_image structure.
1273+
* Note that this function initializes the members of the wolfBoot_image structure
1274+
* but does not initialize the structure itself. It is expected that the wolfBoot_image
1275+
* struct is memset to 0 before being passed in, with image->hdr optionally set.
12731276
*
12741277
* @param img The pointer to the wolfBoot_image structure to be initialized.
12751278
* @param image The pointer to the image address.

0 commit comments

Comments
 (0)