Skip to content

Commit

Permalink
manifest: fix file size check in resign_image
Browse files Browse the repository at this point in the history
This will allow to use size variable in < 0 checks

Signed-off-by: Adrian Bonislawski <[email protected]>
  • Loading branch information
abonislawski committed Jul 10, 2024
1 parent 9d45332 commit 9103c44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,8 @@ int resign_image(struct image *image)
{
int key_size, key_file_size;
void *buffer = NULL;
size_t size, read;
size_t read;
int32_t size;
FILE *in_file;
int ret, i;

Expand Down Expand Up @@ -1487,7 +1488,7 @@ int resign_image(struct image *image)
/* read file into buffer */
read = fread(buffer, 1, size, in_file);
if (read != size) {
fprintf(stderr, "error: unable to read %zu bytes from %s err %d\n",
fprintf(stderr, "error: unable to read %d bytes from %s err %d\n",
size, image->in_file, errno);
ret = errno;
goto out;
Expand Down

0 comments on commit 9103c44

Please sign in to comment.