diff options
author | Kai Blin <kai@samba.org> | 2007-12-15 23:15:18 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:50:30 +0100 |
commit | 3dc7779c6138b6a89d778dba0571abf01e7f7c7a (patch) | |
tree | b5cf490ea5515e6cdedfa49ea4938190005c733a | |
parent | 1bc38f9fb39eec46b31fa4ef36699b8f52f52350 (diff) | |
download | samba-3dc7779c6138b6a89d778dba0571abf01e7f7c7a.tar.gz samba-3dc7779c6138b6a89d778dba0571abf01e7f7c7a.tar.bz2 samba-3dc7779c6138b6a89d778dba0571abf01e7f7c7a.zip |
r26465: ntlm_auth: Remoce pstring.
(This used to be commit 15b388ce51cafcf09301fe6d8a50922a3b9b43d1)
-rw-r--r-- | source4/utils/ntlm_auth.c | 15 |
1 files changed, 12 insertions, 3 deletions
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; } |