From 3dc7779c6138b6a89d778dba0571abf01e7f7c7a Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Sat, 15 Dec 2007 23:15:18 +0100 Subject: r26465: ntlm_auth: Remoce pstring. (This used to be commit 15b388ce51cafcf09301fe6d8a50922a3b9b43d1) --- source4/utils/ntlm_auth.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source4/utils/ntlm_auth.c') diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c index b224689d70..3144fe91b1 100644 --- a/source4/utils/ntlm_auth.c +++ b/source4/utils/ntlm_auth.c @@ -339,16 +339,25 @@ static const char *get_password(struct cli_credentials *credentials) **/ static bool in_list(const char *s, const char *list, bool casesensitive) { - pstring tok; + char *tok; + size_t tok_len = 1024; const char *p=list; if (!list) return false; - while (next_token(&p, tok, LIST_SEP, sizeof(tok))) { - if ((casesensitive?strcmp:strcasecmp_m)(tok,s) == 0) + tok = (char *)malloc(tok_len); + if (!tok) { + return false; + } + + while (next_token(&p, tok, LIST_SEP, tok_len)) { + if ((casesensitive?strcmp:strcasecmp_m)(tok,s) == 0) { + free(tok); return true; + } } + free(tok); return false; } -- cgit