In the case where extended communities to str function is called with a
filtering mecanism, then the case that the returned buffer is not inited
may happen. Hence the change done.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
/* Prepare buffer. */
str_buf = XMALLOC (MTYPE_ECOMMUNITY_STR, ECOMMUNITY_STR_DEFAULT_LEN + 1);
str_size = ECOMMUNITY_STR_DEFAULT_LEN + 1;
+ str_buf[0] = '\0';
str_pnt = 0;
for (i = 0; i < ecom->size; i++)
case ECOMMUNITY_ENCODE_OPAQUE:
if(filter == ECOMMUNITY_ROUTE_TARGET)
{
- first = 0;
continue;
}
if (*pnt == ECOMMUNITY_OPAQUE_SUBTYPE_ENCAP)
case ECOMMUNITY_ENCODE_EVPN:
if(filter == ECOMMUNITY_ROUTE_TARGET)
{
- first = 0;
continue;
}
if (*pnt == ECOMMUNITY_SITE_ORIGIN)
{
u_int8_t *p;
int c;
- struct ecommunity_val *ecom_val;
/* If the value already exists in the structure return 0. */
c = 0;