summaryrefslogtreecommitdiffstats
path: root/src/plugins/stn
diff options
context:
space:
mode:
authorMilan Lenco <milan.lenco@pantheon.tech>2018-05-03 17:31:46 +0200
committerNeale Ranns <nranns@cisco.com>2018-05-04 08:12:45 +0000
commitca07219df974d2d3d49cca37400924af848f2389 (patch)
tree38f6f8df24ba02a199631d74fc602a678aebbf89 /src/plugins/stn
parent8b6b5ab7dba7cb5fe738c887e27c65bee6a2f600 (diff)
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 <milan.lenco@pantheon.tech>
Diffstat (limited to 'src/plugins/stn')
-rw-r--r--src/plugins/stn/stn.c4
1 files 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))
{