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