diff --git a/docs/lib.md b/docs/lib.md index 7827191562..a7a4e75c2f 100644 --- a/docs/lib.md +++ b/docs/lib.md @@ -15,7 +15,7 @@ is initialized when `wolfBoot_open_image_address()` is called. The signature is: `int wolfBoot_open_image_address(struct wolfBoot_image* img, uint8_t* image)` -where `img` is a pointer to a local (uninitialized) structure of type `wolfBoot_image`, and +where `img` is a pointer to a local (memset but otherwise uninitialized) structure of type `wolfBoot_image`, and `image` is a pointer to where the signed image is mapped in memory, starting from the beginning of the manifest header. diff --git a/src/image.c b/src/image.c index b712114c27..59890d4912 100644 --- a/src/image.c +++ b/src/image.c @@ -1270,6 +1270,9 @@ uint32_t wolfBoot_image_size(uint8_t *image) * * This function opens an image using the provided image address and initializes * the wolfBoot_image structure. + * Note that this function initializes the members of the wolfBoot_image structure + * but does not initialize the structure itself. It is expected that the wolfBoot_image + * struct is memset to 0 before being passed in, with img->hdr optionally set. * * @param img The pointer to the wolfBoot_image structure to be initialized. * @param image The pointer to the image address.