[libvirt] [PATCH 0/3] Fix remote dispatch code trying to allocate 0-sized return buffers

Erik Skultety eskultet at redhat.com
Mon Nov 18 12:18:16 UTC 2019

This happens because of the switch to glib whose method g_malloc0 actually
correctly returns NULL on size 0 which doesn't make sense to do. The outcome of
that is that because virAllocN always returns 0, the dispatch code never fails
allocation and passes the NULL pointer to the server-side public API which
actually checks that and fails.


Erik Skultety (3):
  rpc: gendispatch: Fix a couple of places adding trailing spaces
  rpc: gendispatch: Add a check for zero size client-side buffers
  libvirt-domain: virConnectListDomains: Return 0 on zero-size buffer

 src/libvirt-domain.c   |  3 +++
 src/rpc/gendispatch.pl | 12 ++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)


More information about the libvir-list mailing list