[PATCH] Fix segfault in GetIOThreadInfo

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

 



The pointers calculation included a typo which caused segfaults.

Signed-off-by: Leonid Podolny <leonid@xxxxxxxxxxx>
---
 domain.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/domain.go b/domain.go
index 515138a..74061c2 100644
--- a/domain.go
+++ b/domain.go
@@ -3887,7 +3887,7 @@ func (d *Domain) GetIOThreadInfo(flags DomainModificationImpact) ([]DomainIOThre
 	info := make([]DomainIOThreadInfo, int(ret))
 
 	for i := 0; i < int(ret); i++ {
-		cinfo := (*(**C.virDomainIOThreadInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(cinfolist)) + (unsafe.Sizeof(*cinfolist) + uintptr(i)))))
+		cinfo := (*(**C.virDomainIOThreadInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(cinfolist)) + (unsafe.Sizeof(*cinfolist) * uintptr(i)))))
 
 		ncpus := int(cinfo.cpumaplen * 8)
 		cpumap := make([]bool, ncpus)
-- 
2.11.0

--
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]
  Powered by Linux