[libvirt] [PATCH] conf: fix use of uninitialized variable

Nikolay Shirokovskiy posted 1 patch 6 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1508248593-543651-1-git-send-email-nshirokovskiy@virtuozzo.com
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] conf: fix use of uninitialized variable
Posted by Nikolay Shirokovskiy 6 years, 6 months ago
If same boot order is specified twice (or more) in domain xml
we call free for uninitiaziled loadparm on cleanup in virDomainDeviceBootParseXML
and SIGABRT (or similar) as a result.
---
 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 516f9fa..25d48f9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6188,7 +6188,7 @@ virDomainDeviceBootParseXML(xmlNodePtr node,
                             virHashTablePtr bootHash)
 {
     char *order;
-    char *loadparm;
+    char *loadparm = NULL;
     int ret = -1;
 
     if (!(order = virXMLPropString(node, "order"))) {
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] conf: fix use of uninitialized variable
Posted by John Ferlan 6 years, 6 months ago

On 10/17/2017 09:56 AM, Nikolay Shirokovskiy wrote:
> If same boot order is specified twice (or more) in domain xml
> we call free for uninitiaziled loadparm on cleanup in virDomainDeviceBootParseXML
> and SIGABRT (or similar) as a result.
> ---
>  src/conf/domain_conf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

(and pushed) - Tks -

John

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