From ea86ee6df16e8d9b70ab0352c962c5b8f2d8d6cb Mon Sep 17 00:00:00 2001 From: sekaiacg Date: Thu, 11 Jan 2024 10:43:21 +0800 Subject: [PATCH] kptools: Fix calculation of kpimg length Signed-off-by: sekaiacg --- tools/kptools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kptools.c b/tools/kptools.c index 42c66e92..18bc1db4 100644 --- a/tools/kptools.c +++ b/tools/kptools.c @@ -279,8 +279,8 @@ int patch_image() fprintf(stdout, "[-] kptools open file %s error\n", kpimg); return EXIT_FAILURE; } - fseek(fimage, 0, SEEK_END); - long kpimg_len = ftell(fimage); + fseek(fkpimg, 0, SEEK_END); + long kpimg_len = ftell(fkpimg); fseek(fkpimg, 0, SEEK_SET); fprintf(stdout, "[+] kptools kernel patch image size: 0x%08lx\n", kpimg_len);