From acaa4407ca3be9fb5637790079656f1eabf3848c Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 8 Dec 2016 11:29:13 +1100 Subject: [PATCH] ctdb-tools: Fix memory corruption in "ctdb ip -v" First argument to talloc_asprintf_append() is the string being appended to, not a talloc context. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12470 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/tools/ctdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 7e366edf97e..844c00dc7df 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -1445,7 +1445,7 @@ static void print_ip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, conf = talloc_strdup(mem_ctx, iface->name); } else { conf = talloc_asprintf_append( - mem_ctx, ",%s", iface->name); + conf, ",%s", iface->name); } if (ipinfo[i]->active_idx == j) { @@ -1460,7 +1460,7 @@ static void print_ip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, avail = talloc_strdup(mem_ctx, iface->name); } else { avail = talloc_asprintf_append( - mem_ctx, ",%s", iface->name); + avail, ",%s", iface->name); } }