Skip to content

Commit 9103c44

Browse files
committed
manifest: fix file size check in resign_image
This will allow to use size variable in < 0 checks Signed-off-by: Adrian Bonislawski <[email protected]>
1 parent 9d45332 commit 9103c44

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/manifest.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,8 @@ int resign_image(struct image *image)
14401440
{
14411441
int key_size, key_file_size;
14421442
void *buffer = NULL;
1443-
size_t size, read;
1443+
size_t read;
1444+
int32_t size;
14441445
FILE *in_file;
14451446
int ret, i;
14461447

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

0 commit comments

Comments
 (0)