All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390: ensure NUL termination by strncpy()
@ 2009-11-16 18:53 Roel Kluin
  2009-11-16 21:13 ` Heiko Carstens
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-11-16 18:53 UTC (permalink / raw)
  To: Martin Schwidefsky, Heiko Carstens, linux390, linux-s390,
	Andrew Morton, LKML

For a larger source string, strncpy only NUL terminates when
the size argument is less than the size of the destination string.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 arch/s390/kernel/ipl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Is this maybe needed?

diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 4890ac6..d52fcb4 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -1881,7 +1881,7 @@ void __init setup_ipl(void)
 		break;
 	case IPL_TYPE_NSS:
 		strncpy(ipl_info.data.nss.name, kernel_nss_name,
-			sizeof(ipl_info.data.nss.name));
+			sizeof(ipl_info.data.nss.name) - 1);
 		break;
 	case IPL_TYPE_UNKNOWN:
 		/* We have no info to copy */

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

end of thread, other threads:[~2009-11-16 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-16 18:53 [PATCH] s390: ensure NUL termination by strncpy() Roel Kluin
2009-11-16 21:13 ` Heiko Carstens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.