1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +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>
(cherry picked from commit acaa4407ca3be9fb5637790079656f1eabf3848c)
This commit is contained in:
Martin Schwenke 2016-12-08 11:29:13 +11:00 committed by Karolin Seeger
parent e04ef4c049
commit 25ba90d1e4

View File

@ -1444,7 +1444,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) {
@ -1459,7 +1459,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);
}
}