2009-08-17 08:08:56 +00:00
|
|
|
From d5d67ea357d92759d4a9ecb213e577835f961eed Mon Sep 17 00:00:00 2001
|
|
|
|
From: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
Date: Thu, 16 Jul 2009 13:23:32 +0100
|
|
|
|
Subject: [PATCH] Fix free of unitialized data upon PCI open fail
|
2009-08-05 15:48:14 +00:00
|
|
|
|
2009-08-17 08:08:56 +00:00
|
|
|
(cherry picked from commit 4a7acedd3c59a6a750576cb8680bc3f08fe0b52c)
|
|
|
|
|
|
|
|
Fedora-patch: libvirt-0.6.2-pci-device-crash.patch
|
|
|
|
---
|
|
|
|
src/pci.c | 4 +---
|
|
|
|
1 files changed, 1 insertions(+), 3 deletions(-)
|
2009-08-05 15:48:14 +00:00
|
|
|
|
|
|
|
diff --git a/src/pci.c b/src/pci.c
|
2009-08-17 08:08:56 +00:00
|
|
|
index ed64d68..68a380d 100644
|
2009-08-05 15:48:14 +00:00
|
|
|
--- a/src/pci.c
|
|
|
|
+++ b/src/pci.c
|
2009-08-17 08:08:56 +00:00
|
|
|
@@ -829,10 +829,8 @@ pciReadDeviceID(pciDevice *dev, const char *id_name)
|
2009-08-05 15:48:14 +00:00
|
|
|
dev->name, id_name);
|
|
|
|
|
|
|
|
/* ID string is '0xNNNN\n' ... i.e. 7 bytes */
|
|
|
|
- if (virFileReadAll(path, 7, &id_str) < 7) {
|
|
|
|
- VIR_FREE(id_str);
|
|
|
|
+ if (virFileReadAll(path, 7, &id_str) < 0)
|
|
|
|
return NULL;
|
|
|
|
- }
|
|
|
|
|
|
|
|
/* Check for 0x suffix */
|
|
|
|
if (id_str[0] != '0' || id_str[1] != 'x') {
|
2009-08-17 08:08:56 +00:00
|
|
|
--
|
|
|
|
1.6.2.5
|
|
|
|
|