diff --git a/ctdb/lib/util/db_wrap.c b/ctdb/lib/util/db_wrap.c index 1b2bf7e2281..bc174a42a84 100644 --- a/ctdb/lib/util/db_wrap.c +++ b/ctdb/lib/util/db_wrap.c @@ -47,8 +47,8 @@ static void log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const ch { if (level <= TDB_DEBUG_ERROR) { va_list ap; - this_log_level = level; char newfmt[strlen(tdb_name(tdb)) + 1 + strlen(fmt) + 1]; + this_log_level = level; sprintf(newfmt, "%s:%s", tdb_name(tdb), fmt); va_start(ap, fmt); do_debug_v(newfmt, ap); diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c index d45b7f6c5b5..d033b2126e2 100644 --- a/ctdb/server/ctdb_recover.c +++ b/ctdb/server/ctdb_recover.c @@ -31,10 +31,11 @@ int ctdb_control_getvnnmap(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA indata, TDB_DATA *outdata) { - CHECK_CONTROL_DATA_SIZE(0); struct ctdb_vnn_map_wire *map; size_t len; + CHECK_CONTROL_DATA_SIZE(0); + len = offsetof(struct ctdb_vnn_map_wire, map) + sizeof(uint32_t)*ctdb->vnn_map->size; map = talloc_size(outdata, len); CTDB_NO_MEMORY(ctdb, map);