1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

s3 ldb: Fix vasprintf segfault that has been the source of build machine failures this week

The bug was introduced when converting samba3's ldb_search interface
to match samba4:
47951fc5d0085e124666b7667715bba98076820e
f3ecb701335b1129947127d4c45eef970b66875c
This commit is contained in:
Tim Prouty 2009-01-23 16:09:13 -08:00
parent 48a6feef40
commit 0998d172db

View File

@ -808,15 +808,18 @@ int ldb_search(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_result *
va_list ap; va_list ap;
int ret; int ret;
expression = NULL;
res = NULL; res = NULL;
*result = NULL; *result = NULL;
va_start(ap, exp_fmt); if (exp_fmt) {
expression = talloc_vasprintf(mem_ctx, exp_fmt, ap); va_start(ap, exp_fmt);
va_end(ap); expression = talloc_vasprintf(mem_ctx, exp_fmt, ap);
va_end(ap);
if ( ! expression) { if ( ! expression) {
return LDB_ERR_OPERATIONS_ERROR; return LDB_ERR_OPERATIONS_ERROR;
}
} }
ret = _ldb_search(ldb, ldb, &res, base, scope, attrs, expression); ret = _ldb_search(ldb, ldb, &res, base, scope, attrs, expression);