From bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 3 Dec 2007 14:54:06 -0800 Subject: Change tdb_unpack "P" to return a malloc'ed string rather than expect a pstring space to put data into. Fix the (few) callers. Jeremy. (This used to be commit 7722a7d2c63f84b8105aa775b39f0ceedd4ed513) --- source3/passdb/secrets.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/passdb/secrets.c') diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index c760198b2d..eee8aaed2d 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -484,6 +484,7 @@ static size_t tdb_trusted_dom_pass_unpack(uint8 *pack_buf, int bufsize, TRUSTED_DOM_PASS* pass) { int idx, len = 0; + char *passp = NULL; if (!pack_buf || !pass) return -1; @@ -495,7 +496,11 @@ static size_t tdb_trusted_dom_pass_unpack(uint8 *pack_buf, int bufsize, &pass->uni_name[idx]); len += tdb_unpack(pack_buf + len, bufsize - len, "dPd", - &pass->pass_len, &pass->pass, &pass->mod_time); + &pass->pass_len, &passp, &pass->mod_time); + if (passp) { + fstrcpy(pass->pass, passp); + } + SAFE_FREE(passp); /* unpack domain sid */ len += tdb_sid_unpack(pack_buf + len, bufsize - len, -- cgit