public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390: net: ctcm_main.c:  Cleaning up missing null-terminate in conjunction with strncpy
@ 2014-07-26 14:33 Rickard Strandqvist
  2014-07-29 13:11 ` Ursula Braun
  0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2014-07-26 14:33 UTC (permalink / raw)
  To: Ursula Braun, Frank Blaschka
  Cc: Rickard Strandqvist, linux390, Martin Schwidefsky, Heiko Carstens,
	linux-s390, linux-kernel

Replacing strncpy with strlcpy to avoid strings that lacks null terminate.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/s390/net/ctcm_main.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index 03b6ad0..670fa7d 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -204,8 +204,8 @@ static void channel_remove(struct channel *ch)
 
 	if (ch == NULL)
 		return;
-	else
-		strncpy(chid, ch->id, CTCM_ID_SIZE);
+
+	strlcpy(chid, ch->id, CTCM_ID_SIZE);
 
 	channel_free(ch);
 	while (*c) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-29 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-26 14:33 [PATCH] s390: net: ctcm_main.c: Cleaning up missing null-terminate in conjunction with strncpy Rickard Strandqvist
2014-07-29 13:11 ` Ursula Braun
     [not found]   ` <CAFo99gb2sSHVhDG0x6FzYi+YcKT7hQnu7qmUG=kaXyNaq4vKzw@mail.gmail.com>
2014-07-29 14:35     ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox