diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2020-10-11 16:19:37 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2020-10-11 16:20:45 +0200 |
commit | 4e89e0e0eaff0c86f9ff71f04860c3e210c39490 (patch) | |
tree | aa66249457c7b254e2d6987b1d215852c547c35f /utils | |
parent | 6533d983ca48b48563cd6177c2a9d4ad1a84b749 (diff) |
nwztools: fix wrongly generate MD5 files
When generating the MD5 using -z index,name the tool would add the entry but
forgot to increase the file size, hence truncating the file.
Change-Id: Ibd3c594722ab46350cda60d158666fe34a96e922
Diffstat (limited to 'utils')
-rw-r--r-- | utils/nwztools/upgtools/upgtool.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/utils/nwztools/upgtools/upgtool.c b/utils/nwztools/upgtools/upgtool.c index 8235e487bf..b573532d6e 100644 --- a/utils/nwztools/upgtools/upgtool.c +++ b/utils/nwztools/upgtools/upgtool.c @@ -470,6 +470,7 @@ static int create_upg(int argc, char **argv) upg->files[1].data = realloc(upg->files[1].data, upg->files[1].size + md5_prepend_sz); memmove(upg->files[1].data + md5_prepend_sz, upg->files[1].data, upg->files[1].size); memcpy(upg->files[1].data, md5_prepend, md5_prepend_sz); + upg->files[1].size += md5_prepend_sz; size_t size = 0; void *buf = upg_write_memory(upg, g_key, g_sig, &size, NULL, generic_std_printf); |