summaryrefslogtreecommitdiff
path: root/source4/utils/ntlm_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/utils/ntlm_auth.c')
-rw-r--r--source4/utils/ntlm_auth.c15
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;
}