[CRIU] [PATCH] criu: Require @fd argument for "swrk" mode

Cyrill Gorcunov gorcunov at openvz.org
Mon Sep 14 13:09:40 PDT 2015


Otherwise we hit nil dereference.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 crtools.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/crtools.c b/crtools.c
index f10e5c00126a..838e7d9c50c9 100644
--- a/crtools.c
+++ b/crtools.c
@@ -269,6 +269,8 @@ int main(int argc, char *argv[], char *envp[])
 		return 1;
 
 	if (!strcmp(argv[1], "swrk")) {
+		if (argc < 3)
+			goto usage;
 		/*
 		 * This is to start criu service worker from libcriu calls.
 		 * The usage is "criu swrk <fd>" and is not for CLI/scripts.
-- 
2.4.3



More information about the CRIU mailing list