mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
Add bounds checking on virConnectListAllStoragePools RPC call
The return values for the virConnectListAllStoragePools 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
9e97128ba5
commit
c853fa8feb
3 files changed
+19
-5
No files matched your search
@@ -4073,6 +4073,13 @@ remoteDispatchConnectListAllStoragePools(virNetServerPtr server ATTRIBUTE_UNUSED
|
||||
args->flags)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (npools > REMOTE_STORAGE_POOL_LIST_MAX) {
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("Too many storage pools '%d' for limit '%d'"),
|
||||
npools, REMOTE_STORAGE_POOL_LIST_MAX);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (pools && npools) {
|
||||
if (VIR_ALLOC_N(ret->pools.pools_val, npools) < 0)
|
||||
goto cleanup;
|
||||
|
||||
Reference in new issue
Block a user