Commit 482c9af4 authored by Shaka Huang's avatar Shaka Huang Committed by John Wu

Fix segmentation fault

When both keepverity and keepforceencrypt are false, ‘e’ will be freed after removing ‘verity_key’ and segmentation fault might happened in strstr(e->filename, “fstab”)
Signed-off-by: 's avatarShaka Huang <shakalaca@gmail.com>
parent 2bf2e746
...@@ -21,6 +21,7 @@ static void cpio_patch(struct vector *v, int keepverity, int keepforceencrypt) { ...@@ -21,6 +21,7 @@ static void cpio_patch(struct vector *v, int keepverity, int keepforceencrypt) {
fprintf(stderr, "Remove [verity_key]\n"); fprintf(stderr, "Remove [verity_key]\n");
cpio_free(e); cpio_free(e);
vec_cur(v) = NULL; vec_cur(v) = NULL;
continue;
} }
} }
if (!keepforceencrypt) { if (!keepforceencrypt) {
......
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