lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 17 Aug 2018 22:20:38 +0200
From:   Harshit Jain <harshitjain6751@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     Harshit Jain <harshitjain6751@...il.com>,
        Tony Finch <dot@...at.at>, linux-kernel@...r.kernel.org
Subject: [PATCH] scripts: unifdef: fix stringop-truncation warning

While compiling the mainline kernel in android env with latest gcc 8 the compiler threw this warning Thanks to the advantage of improved static analysis in newer gcc we are now able to
see this warning this patch resolves the detected compiler warnings.

Signed-off-by: Harshit Jain <harshitjain6751@...il.com>
---
 scripts/unifdef.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/unifdef.c b/scripts/unifdef.c
index 7493c0ee51cc..985649805cdd 100644
--- a/scripts/unifdef.c
+++ b/scripts/unifdef.c
@@ -450,7 +450,7 @@ static void Idrop (void) { Fdrop();  ignoreon(); }
 static void Itrue (void) { Ftrue();  ignoreon(); }
 static void Ifalse(void) { Ffalse(); ignoreon(); }
 /* modify this line */
-static void Mpass (void) { strncpy(keyword, "if  ", 4); Pelif(); }
+static void Mpass (void) { memcpy(keyword, "if  ", 4); Pelif(); }
 static void Mtrue (void) { keywordedit("else");  state(IS_TRUE_MIDDLE); }
 static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); }
 static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); }
-- 
2.18.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ