Unverified Commit e45820dc authored by davidcunado-arm's avatar davidcunado-arm Committed by GitHub
Browse files

Merge pull request #1242 from afaerber/fiptool-hikey-pad

fiptool: Fix use after free
parents e282b9d9 8e4cdd22
...@@ -543,7 +543,6 @@ static int pack_images(const char *filename, uint64_t toc_flags, unsigned long a ...@@ -543,7 +543,6 @@ static int pack_images(const char *filename, uint64_t toc_flags, unsigned long a
log_dbgx("Metadata size: %zu bytes", buf_size); log_dbgx("Metadata size: %zu bytes", buf_size);
xfwrite(buf, buf_size, fp, filename); xfwrite(buf, buf_size, fp, filename);
free(buf);
if (verbose) if (verbose)
log_dbgx("Payload size: %zu bytes", payload_size); log_dbgx("Payload size: %zu bytes", payload_size);
...@@ -566,6 +565,7 @@ static int pack_images(const char *filename, uint64_t toc_flags, unsigned long a ...@@ -566,6 +565,7 @@ static int pack_images(const char *filename, uint64_t toc_flags, unsigned long a
while (pad_size--) while (pad_size--)
fputc(0x0, fp); fputc(0x0, fp);
free(buf);
fclose(fp); fclose(fp);
return 0; return 0;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment