All of lore.kernel.org
 help / color / mirror / Atom feed
* [CRIU][PATCH v2 16/17] zdtm/static/fdt_shared: Fix buffer size
@ 2017-06-29 19:24 Michael Holzheu
  0 siblings, 0 replies; only message in thread
From: Michael Holzheu @ 2017-06-29 19:24 UTC (permalink / raw)
  To: linux-s390

The TEST_STRING "Hello World!" has 13 bytes size. Therefore the 10 bytes
used for the buffer size are not sufficient.

Fix this and use sizeof() to be on the safe side.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
---
 test/zdtm/static/fdt_shared.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/zdtm/static/fdt_shared.c b/test/zdtm/static/fdt_shared.c
index b1c74d0..2111356 100644
--- a/test/zdtm/static/fdt_shared.c
+++ b/test/zdtm/static/fdt_shared.c
@@ -62,7 +62,7 @@ static pid_t clone_child(int (*fn)(void *), int flags)
 
 static int child2(void *_arg)
 {
-	char buf[10];
+	char buf[sizeof(TEST_STRING)];
 
 	forked();
 	test_waitsig();
@@ -90,7 +90,7 @@ static int child3(void *_arg)
 
 static int child(void *_arg)
 {
-	char buf[10];
+	char buf[sizeof(TEST_STRING)];
 	pid_t pid, pid2;
 	int status;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-29 19:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29 19:24 [CRIU][PATCH v2 16/17] zdtm/static/fdt_shared: Fix buffer size Michael Holzheu

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.