From: Milan Lenco Date: Thu, 3 May 2018 15:31:46 +0000 (+0200) Subject: Fix format for the dst address in the STN trace X-Git-Tag: v18.07-rc1~384 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;ds=sidebyside;h=ca07219df974d2d3d49cca37400924af848f2389;p=vpp.git Fix format for the dst address in the STN trace Output string 's' was not assigned the return value of format() for the destination address, which, in case the underlying memory was moved by the realloc, resulted in an invalid memory access by the subsequent invocations of format(). Change-Id: I2b5dfd85db085c553ca5ec0b3257aeeb437c360a Signed-off-by: Milan Lenco --- diff --git a/src/plugins/stn/stn.c b/src/plugins/stn/stn.c index 2838c4bea0b..9368e1c573e 100644 --- a/src/plugins/stn/stn.c +++ b/src/plugins/stn/stn.c @@ -63,8 +63,8 @@ format_stn_ip46_punt_trace (u8 * s, va_list * args, u8 is_ipv4) stn_ip46_punt_trace_t *t = va_arg (*args, stn_ip46_punt_trace_t *); u32 indent = format_get_indent (s); - format (s, "dst_address: %U\n", format_ip46_address, - (ip46_address_t *)&t->kv.key, IP46_TYPE_ANY); + s = format (s, "dst_address: %U\n", format_ip46_address, + (ip46_address_t *)t->kv.key, IP46_TYPE_ANY); if (t->kv.value == ~(0L)) {