提交 65926db5 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!487 iSulad: resolve coredump of isula inspect ""

Merge pull request !487 from Jackey_1024/ma_0623
......@@ -199,8 +199,9 @@ static int client_inspect_container(const struct isula_inspect_request *request,
ret = ops->container.inspect(request, response, config);
if (ret != 0) {
if ((strstr(response->errmsg, "Inspect invalid name") != NULL) ||
(strstr(response->errmsg, "No such image or container or accelerator") != NULL)) {
if ((response->errmsg != NULL) &&
(strstr(response->errmsg, "Inspect invalid name") != NULL ||
strstr(response->errmsg, "No such image or container or accelerator") != NULL)) {
return CONTAINER_NOT_FOUND;
}
......@@ -814,6 +815,7 @@ int cmd_inspect_main(int argc, const char **argv)
free(filter_string);
if (status) {
COMMAND_ERROR("Inspec error: No such object:%s", g_cmd_inspect_args.name);
exit(ECOMMON);
}
exit(EXIT_SUCCESS);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册