summaryrefslogtreecommitdiff
path: root/ctdb/tools
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-12-08 11:29:13 +1100
committerAmitay Isaacs <amitay@samba.org>2016-12-16 08:42:32 +0100
commitacaa4407ca3be9fb5637790079656f1eabf3848c (patch)
treeec365638da5fa7bd904503931c43e839b046cac9 /ctdb/tools
parent7bcef2f0e2969551134e0d72f0956685eeec10a3 (diff)
downloadsamba-acaa4407ca3be9fb5637790079656f1eabf3848c.tar.gz
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 <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tools')
-rw-r--r--ctdb/tools/ctdb.c4
1 files 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);
}
}