1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Martin Schwenke 2016-12-08 11:29:13 +11:00 committed by Amitay Isaacs
parent 7bcef2f0e2
commit acaa4407ca

View File

@ -1445,7 +1445,7 @@ static void print_ip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
conf = talloc_strdup(mem_ctx, iface->name); conf = talloc_strdup(mem_ctx, iface->name);
} else { } else {
conf = talloc_asprintf_append( conf = talloc_asprintf_append(
mem_ctx, ",%s", iface->name); conf, ",%s", iface->name);
} }
if (ipinfo[i]->active_idx == j) { 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); avail = talloc_strdup(mem_ctx, iface->name);
} else { } else {
avail = talloc_asprintf_append( avail = talloc_asprintf_append(
mem_ctx, ",%s", iface->name); avail, ",%s", iface->name);
} }
} }