mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
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: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
79bd55b302
commit
f84c6dd26d
@ -319,6 +319,12 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ver_info->capabilities) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("Failed to get capabilities from libxenlight"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
err = regcomp(®ex, XEN_CAP_REGEX, REG_EXTENDED);
|
err = regcomp(®ex, XEN_CAP_REGEX, REG_EXTENDED);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
char error[100];
|
char error[100];
|
||||||
|
Loading…
Reference in New Issue
Block a user