mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Add bounds checking on virConnectListAllNWFilters RPC call
The return values for the virConnectListAllNWFilters 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:
@@ -4374,6 +4374,13 @@ remoteDispatchConnectListAllNWFilters(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
args->flags)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (nfilters > REMOTE_NWFILTER_LIST_MAX) {
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("Too many network filters '%d' for limit '%d'"),
|
||||
nfilters, REMOTE_NWFILTER_LIST_MAX);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (filters && nfilters) {
|
||||
if (VIR_ALLOC_N(ret->filters.filters_val, nfilters) < 0)
|
||||
goto cleanup;
|
||||
|
||||
Reference in New Issue
Block a user