mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 23:05:39 +00:00
action-scripts: check a return code of get_service_fd
>>> CID 190177: Integer handling issues (NEGATIVE_RETURNS) >>> rpc_sk is passed to a parameter that cannot be negative. Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
@@ -108,6 +108,8 @@ int rpc_send_fd(enum script_actions act, int fd)
|
||||
return -1;
|
||||
|
||||
rpc_sk = get_service_fd(RPC_SK_OFF);
|
||||
if (rpc_sk < 0)
|
||||
return -1;
|
||||
|
||||
pr_debug("\tRPC\n");
|
||||
return send_criu_rpc_script(act, (char *)action, rpc_sk, fd);
|
||||
@@ -128,6 +130,10 @@ int run_scripts(enum script_actions act)
|
||||
|
||||
pr_debug("\tRPC\n");
|
||||
rpc_sk = get_service_fd(RPC_SK_OFF);
|
||||
if (rpc_sk < 0) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
ret = send_criu_rpc_script(act, (char *)action, rpc_sk, -1);
|
||||
goto out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user