提交 f84c6dd2 编写于 作者: J John Ferlan

libxl: Resolve Coverity FORWARD_NULL

Since the strtok_r call in libxlCapsInitGuests expects a non NULL first
parameter when the third parameter is NULL, we need to check that
the returned 'capabilities' from a libxl_get_version_info call is
not NULL and error out if so since the code expects it.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 79bd55b3
......@@ -319,6 +319,12 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
return -1;
}
if (!ver_info->capabilities) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to get capabilities from libxenlight"));
return -1;
}
err = regcomp(&regex, XEN_CAP_REGEX, REG_EXTENDED);
if (err != 0) {
char error[100];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册