mirror of https://gitee.com/openkylin/libvirt.git
xend_internal: don't let invalid input provoke NULL dereference
* src/xen/xend_internal.c (xenDaemonOpen_unix): Do not dereference a NULL "conn". Move first deref to follow the "conn == NULL" test.
This commit is contained in:
parent
7a90f21655
commit
7679f064bf
|
@ -748,11 +748,12 @@ int
|
|||
xenDaemonOpen_unix(virConnectPtr conn, const char *path)
|
||||
{
|
||||
struct sockaddr_un *addr;
|
||||
xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
|
||||
xenUnifiedPrivatePtr priv;
|
||||
|
||||
if ((conn == NULL) || (path == NULL))
|
||||
return (-1);
|
||||
|
||||
priv = (xenUnifiedPrivatePtr) conn->privateData;
|
||||
memset(&priv->addr, 0, sizeof(priv->addr));
|
||||
priv->addrfamily = AF_UNIX;
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue