7090778 Problem with network/quagga s11u1-03
authorBrian Utterback <Brian.Utterback@Oracle.COM>
Wed, 09 Nov 2011 09:11:11 -0800
changeset 576 507cfe0a7b1e
parent 575 9b55b6329084
child 577 c13e8d244261
7090778 Problem with network/quagga
components/quagga/patches/23-cve-2011-3327.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/quagga/patches/23-cve-2011-3327.patch	Wed Nov 09 09:11:11 2011 -0800
@@ -0,0 +1,30 @@
+--- bgpd/bgp_ecommunity.c
++++ bgpd/bgp_ecommunity.c
[email protected]@ -568,6 +568,13 @@
+ 
+   for (i = 0; i < ecom->size; i++)
+     {
++      /* Make sure the size is large enough. */
++      while (str_pnt + ECOMMUNITY_STR_DEFAULT_LEN >= str_size)
++	{
++	  str_size *= 2;
++	  str_buf = XREALLOC (MTYPE_ECOMMUNITY_STR, str_buf, str_size);
++	}
++
+       /* Space between each value.  */
+       if (! first)
+ 	str_buf[str_pnt++] = ' ';
[email protected]@ -610,13 +617,6 @@
+ 	  break;
+ 	}
+ 
+-      /* Make it sure size is enough.  */
+-      while (str_pnt + ECOMMUNITY_STR_DEFAULT_LEN >= str_size)
+-	{
+-	  str_size *= 2;
+-	  str_buf = XREALLOC (MTYPE_ECOMMUNITY_STR, str_buf, str_size);
+-	}
+-
+       /* Put string into buffer.  */
+       if (encode == ECOMMUNITY_ENCODE_AS)
+ 	{