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

[libvirt] [PATCH] Resolve Coverity complaint in storagevolxml2argvtest



Ignore NULL pool in testSetVolumeType to silence Coverity,
even though we only call it with NULL pool when vol is also NULL.

(13) Event var_deref_model:	Passing null pointer "inputpool" to
function "testSetVolumeType(virStorageVolDefPtr, virStoragePoolDefPtr)",
which dereferences it. [details]
Also see events: [assign_zero]

95    testSetVolumeType(inputvol, inputpool);
---
 tests/storagevolxml2argvtest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c
index 7774617..b1cf09f 100644
--- a/tests/storagevolxml2argvtest.c
+++ b/tests/storagevolxml2argvtest.c
@@ -16,7 +16,7 @@ static void
 testSetVolumeType(virStorageVolDefPtr vol,
                   virStoragePoolDefPtr pool)
 {
-    if (!vol)
+    if (!vol || !pool)
         return;
 
     switch (pool->type) {
-- 
1.8.1.5


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