From ca07219df974d2d3d49cca37400924af848f2389 Mon Sep 17 00:00:00 2001 From: Milan Lenco Date: Thu, 3 May 2018 17:31:46 +0200 Subject: [PATCH] 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 --- src/plugins/stn/stn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) { -- 2.16.6