>From 23932dc7f504025b2e3a2c4868d59274937f3c9b Mon Sep 17 00:00:00 2001 From: "feng.pei" Date: Sat, 25 Jul 2020 12:46:38 +0800 Subject: [PATCH 1/1] [app][fitboot] fix cmdline overlay issue Fix cmdline too long cause overlay issue. Change-Id: I55f30cd273b048a395f2034fe1ad6aa3225be463 Signed-off-by: feng.pei CR-Id: AUTO00067404 --- app/fitboot/fitboot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/fitboot/fitboot.c b/app/fitboot/fitboot.c index 46d4af69..897f39a5 100644 --- a/app/fitboot/fitboot.c +++ b/app/fitboot/fitboot.c @@ -343,8 +343,8 @@ static int cmdlineoverlay(void *boot_dtb, char *cmdline, int len) mtdnum ++; sprintf(mtdnum_str_new, "%d", mtdnum); if (mtdnum >= 10) { - char half_before[256] = {'\0'}; - char half_behind[256] = {'\0'}; + char half_before[1024] = {'\0'}; + char half_behind[1024] = {'\0'}; strncpy(half_before, cmdline_read, pos2 - cmdline_read); char *pos3 = strstr(half_before, str_real); strncpy(pos3 + header_length, mtdnum_str_new, 2); -- 2.25.1