mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
Add bounds checking on virConnectListAllDomains RPC call
The return values for the virConnectListAllDomains call were not bounds checked. This is a robustness issue for clients if something where to cause corruption of the RPC stream data. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
1 parent
a43d4f543c
commit
9e97128ba5
3 files changed
+23
-14
No files matched your search
@@ -1050,6 +1050,13 @@ remoteDispatchConnectListAllDomains(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
args->flags)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (ndomains > REMOTE_DOMAIN_LIST_MAX) {
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("Too many domains '%d' for limit '%d'"),
|
||||
ndomains, REMOTE_DOMAIN_LIST_MAX);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (doms && ndomains) {
|
||||
if (VIR_ALLOC_N(ret->domains.domains_val, ndomains) < 0)
|
||||
goto cleanup;
|
||||
|
||||
Reference in new issue
Block a user