[PATCH] util: fix libvirtd crash caused by virStorageNetHostTransportTypeFromString

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

 



When split uri->scheme into two strings with "+", the second one will be
"rdma://server/..", pass it to virStorageNetHostTransportTypeFromString
will lead libvirtd crash. So a second virStringSplit call is needed.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1156288
Signed-off-by: Shanzhi Yu <shyu@xxxxxxxxxx>
---
 src/util/virstoragefile.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 960aa23..795c188 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2144,6 +2144,9 @@ virStorageSourceParseBackingURI(virStorageSourcePtr src,
         goto cleanup;
     }
 
+    if (!(scheme = virStringSplit(scheme[1], ":", 2)))
+        goto cleanup;
+
     if (scheme[1] &&
         (src->hosts->transport = virStorageNetHostTransportTypeFromString(scheme[1])) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-- 
1.9.3

--
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]