Hi,

Please find the latest report on new defect(s) introduced to libvirt found with Coverity Scan.

Defect Details

** CID 913371:       Null pointer dereferences  (FORWARD_NULL)
/src/ch/ch_monitor.c: 342           in virCHMonitorBuildMemoryZonesJSON()


_____________________________________________________________________________________________
*** CID 913371:         Null pointer dereferences  (FORWARD_NULL)
/src/ch/ch_monitor.c: 342             in virCHMonitorBuildMemoryZonesJSON()
336             g_autofree char *id = g_strdup_printf("zone%zu", i);
337             /* Memory returned is in KiB, so we multiply by 1024 */
338             unsigned long long memsize = virDomainNumaGetNodeMemorySize(def->numa, i) * 1024;
339             g_autoptr(virJSONValue) zone = virJSONValueNewObject();
340             virBitmap *nodes = virDomainNumatuneGetNodeset(def->numa, NULL, i);
341             g_autofree char *nodeset = virBitmapFormat(nodes);
>>>     CID 913371:         Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "nodes" to "virBitmapCountBits", which dereferences it. (The dereference is assumed on the basis of the "nonnull" parameter attribute.)
342             size_t hostNodeCount = virBitmapCountBits(nodes);
343             size_t hostNode = virBitmapLastSetBit(nodes);
344     
345             if (hostNodeCount > 1) {
346                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
347                                _("%1$ld host nodes specified but Cloud Hypervisor only supports 1"),

** CID 913370:       Insecure data handling  (TAINTED_STRING)


_____________________________________________________________________________________________
*** CID 913370:         Insecure data handling  (TAINTED_STRING)
/tests/qemuprocesstest.c: 144             in main()
138         DO_TEST("GetAllCpuAffinity: non-overlapping isolated CPUs -> NULL (hot-plug fix)",
139                 testGetAllCpuAffinityNonOverlapping);
140     
141         return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
142     }
143     
>>>     CID 913370:         Insecure data handling  (TAINTED_STRING)
>>>     Passing tainted string "**argv" to "virTestMain", which cannot accept tainted data.

** CID 913369:       Resource leaks  (RESOURCE_LEAK)
/src/ch/ch_monitor.c: 89           in virCHMonitorBuildCPUTopologyJSON()


_____________________________________________________________________________________________
*** CID 913369:         Resource leaks  (RESOURCE_LEAK)
/src/ch/ch_monitor.c: 89             in virCHMonitorBuildCPUTopologyJSON()
83                                   "u:cores_per_die", vmdef->cpu->cores,
84                                   "u:dies_per_package", vmdef->cpu->dies,
85                                   "u:packages", vmdef->cpu->sockets,
86                                   NULL) < 0)
87             return -1;
88     
>>>     CID 913369:         Resource leaks  (RESOURCE_LEAK)
>>>     Returning without freeing "content" leaks the storage that it points to.
89         return 0;
90     }
91     
92     static int
93     virCHMonitorBuildCPUJson(virJSONValue *content, virDomainDef *vmdef)
94     {

  

View Defects in Coverity Scan

Best regards,

The Coverity Scan Admin Team