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

Erik Skultety posted 3 patches 4 years, 5 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1574079462.git.eskultet@redhat.com
There is a newer version of this series
src/libvirt-domain.c   |  3 +++
src/rpc/gendispatch.pl | 12 ++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
[libvirt] [PATCH 0/3] Fix remote dispatch code trying to allocate 0-sized return buffers
Posted by Erik Skultety 4 years, 5 months ago
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.

https://bugzilla.redhat.com/show_bug.cgi?id=1772842

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(-)

-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list