Blame SOURCES/0001-network-NULL-dereference-fix.patch

19062e
From b57c64f1aa5c51dd785f2572636b8c41ada06d72 Mon Sep 17 00:00:00 2001
19062e
From: Pavel Raiskup <praiskup@redhat.com>
19062e
Date: Tue, 30 Aug 2011 15:10:46 +0200
19062e
Subject: [PATCH] network: NULL dereference fix
19062e
19062e
Variable ifindex dereferenced on line 242 before null check on line 249.
19062e
---
19062e
 network/common.c | 4 +++-
19062e
 1 file changed, 3 insertions(+), 1 deletion(-)
19062e
19062e
diff --git a/network/common.c b/network/common.c
19062e
index 4704072..a223685 100644
19062e
--- a/network/common.c
19062e
+++ b/network/common.c
19062e
@@ -240,13 +240,15 @@ int bnep_if_down(const char *devname)
19062e
 
19062e
 int bnep_add_to_bridge(const char *devname, const char *bridge)
19062e
 {
19062e
-	int ifindex = if_nametoindex(devname);
19062e
+	int ifindex;
19062e
 	struct ifreq ifr;
19062e
 	int sk, err;
19062e
 
19062e
 	if (!devname || !bridge)
19062e
 		return -EINVAL;
19062e
 
19062e
+	ifindex = if_nametoindex(devname);
19062e
+
19062e
 	sk = socket(AF_INET, SOCK_STREAM, 0);
19062e
 	if (sk < 0)
19062e
 		return -1;
19062e
-- 
19062e
1.8.0.1
19062e