modernize backfire 10.03 so it can be operational again
[openwrt-10.03/.git] / package / quagga / patches-upstream / 320-fix_uninitialized_variables.patch
diff --git a/package/quagga/patches-upstream/320-fix_uninitialized_variables.patch b/package/quagga/patches-upstream/320-fix_uninitialized_variables.patch
new file mode 100644 (file)
index 0000000..7768dcc
--- /dev/null
@@ -0,0 +1,26 @@
+From 3e1d78b2b6b0bffc255b97d40163681fb13a467a Mon Sep 17 00:00:00 2001
+From: Donald Sharp <sharpd@cumulusnetworks.com>
+Date: Fri, 11 Mar 2016 01:16:47 +0000
+Subject: bgpd: Fix code path that leads to uninitialized variables
+
+subtype and sublength are not initialized and if on Line 1877
+BGP_ATTR_ENCAP != type we will not set subtype and sublength,
+but these variables are used immediately below that if statement.
+
+This issue was discovered via the freebsd compiler.
+
+Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
+---
+--- a/bgpd/bgp_attr.c
++++ b/bgpd/bgp_attr.c
+@@ -1870,8 +1870,8 @@ bgp_attr_encap(
+   }
+   while (length >= 4) {
+-    uint16_t  subtype;
+-    uint16_t  sublength;
++    uint16_t  subtype = 0;
++    uint16_t  sublength = 0;
+     struct bgp_attr_encap_subtlv *tlv;
+     if (BGP_ATTR_ENCAP == type) {