[CRIU] [PATCH] zdtm: don't write more than buffer size

Andrey Vagin avagin at openvz.org
Sat Feb 1 12:49:32 PST 2014


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm/lib/ns.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
index fb6d70e..fb2ac11 100644
--- a/test/zdtm/lib/ns.c
+++ b/test/zdtm/lib/ns.c
@@ -145,7 +145,7 @@ static void ns_sig_hand(int signo)
 	return;
 write_out:
 	/* fprintf can't be used in a sighandler due to glibc locks */
-	write(STDERR_FILENO, buf, MAX(len, sizeof(buf)));
+	write(STDERR_FILENO, buf, MIN(len, sizeof(buf)));
 }
 
 #define STATUS_FD 255
-- 
1.8.5.3



More information about the CRIU mailing list