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

[libvirt] [PATCH] conf: Fix the problem which cause libvirtd to crash



* src/conf/domain_conf.c: Use STREQ_NULLABLE instead of STREQ,
as def->seclables[i]->model could be NULL.

---
I guess this doesn't fix the root cause (perhaps on XML parsing),
but this fix is sufficient anyway.
---
 src/conf/domain_conf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c02d6f8..224aec5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14995,7 +14995,7 @@ virDomainDiskDefGetSecurityLabelDef(virDomainDiskDefPtr def, const char *model)
         return NULL;
 
     for (i = 0; i < def->nseclabels; i++) {
-        if (STREQ(def->seclabels[i]->model, model))
+        if (STREQ_NULLABLE(def->seclabels[i]->model, model))
             return def->seclabels[i];
     }
     return NULL;
-- 
1.7.7.3


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