[PATCH 0/9] json: Fix leak/double-free, clean up code and privatize virJSONValue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Coverity was not wrong about the usage of 'a'/'A' modifiers for
virJSONValueObjectAddVArgs as noted in [1]. Fix the possible
leak/double-free, and add test to make sure it works as expected.

This series also cleans up direct access to attributes of virJSONValue
and in the end privatizes the implementation so that all users are
forced to use accessors.

Peter Krempa (9):
  util: json: Fix freeing of objects appended to virJSONValue
  tests: json: Validate that attribute values are properly stolen
  qemu: monitor: Use virJSONValueObjectKeysNumber in
    qemuMonitorJSONGetCPUModelExpansion
  qemu: agent: Avoid unnecessary JSON object type check
  json: Replace access to virJSONValue->type by virJSONValueGetType
  util: json: Add accessor for geting a VIR_JSON_TYPE_NUMBER as string
  util: qemu: Don't access virJSONValue members directly in
    virQEMUBuildCommandLineJSONRecurse
  qemu: monitor: Don't resist stealing 'actions' in
    qemuMonitorJSONTransaction
  util: json: Privatize struct _virJSONValue and sub-structs

 src/libvirt_private.syms     |  1 +
 src/qemu/qemu_agent.c        | 21 +++++-----------
 src/qemu/qemu_block.c        | 22 +++++------------
 src/qemu/qemu_command.c      |  2 +-
 src/qemu/qemu_driver.c       |  4 +--
 src/qemu/qemu_monitor.c      |  4 +--
 src/qemu/qemu_monitor.h      |  2 +-
 src/qemu/qemu_monitor_json.c | 59 ++++++++++++++------------------------------
 src/qemu/qemu_monitor_json.h |  2 +-
 src/util/virjson.c           | 59 +++++++++++++++++++++++++++++++++++++++++---
 src/util/virjson.h           | 39 +----------------------------
 src/util/virqemu.c           | 13 ++++++----
 tests/qemublocktest.c        |  4 +--
 tests/virjsontest.c          | 47 +++++++++++++++++++++++++++++++++++
 14 files changed, 152 insertions(+), 127 deletions(-)

-- 
2.16.2

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux