Re: [PATCH 1/3] umlConnectTapDevice: initialize tapfd variable

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

 



On 23/05/13 22:05, Michal Privoznik wrote:
There is possibility to jump to 'cleanup' label without tapfd variable
being initialized. In the label, VIR_FORCE_CLOSE(tapfd) is called which
can have fatal consequences.
---
  src/uml/uml_conf.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index a4088f2..38dcfbb 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -109,7 +109,7 @@ umlConnectTapDevice(virConnectPtr conn,
                      const char *bridge)
  {
      bool template_ifname = false;
-    int tapfd;
+    int tapfd = -1;
if (!net->ifname ||
          STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX) ||
ACK.

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