lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1470204425-40078-1-git-send-email-roopa@cumulusnetworks.com>
Date:	Tue,  2 Aug 2016 23:07:05 -0700
From:	Roopa Prabhu <roopa@...ulusnetworks.com>
To:	stephen@...workplumber.org
Cc:	netdev@...r.kernel.org
Subject: [PATCH iproute2 net-next] bridge: print_vlan: add missing check for json instance

From: Roopa Prabhu <roopa@...ulusnetworks.com>

Also initialize vlan_flags

Fixes: d82a49ce85f0 ("bridge: add json support for bridge vlan show")
Signed-off-by: Roopa Prabhu <roopa@...ulusnetworks.com>
---
 bridge/vlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bridge/vlan.c b/bridge/vlan.c
index f262cc7..22f32a5 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -188,7 +188,7 @@ static int print_vlan(const struct sockaddr_nl *who,
 	struct ifinfomsg *ifm = NLMSG_DATA(n);
 	int len = n->nlmsg_len;
 	struct rtattr *tb[IFLA_MAX+1];
-	bool vlan_flags;
+	bool vlan_flags = false;
 
 	if (n->nlmsg_type != RTM_NEWLINK) {
 		fprintf(stderr, "Not RTM_NEWLINK: %08x %08x %08x\n",
@@ -276,7 +276,7 @@ static int print_vlan(const struct sockaddr_nl *who,
 					fprintf(fp, " Egress Untagged");
 				}
 			}
-			if (vlan_flags) {
+			if (jw_global && vlan_flags) {
 				jsonw_end_array(jw_global);
 				vlan_flags = false;
 			}
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ