r26465: ntlm_auth: Remoce pstring.
authorKai Blin <kai@samba.org>
Sat, 15 Dec 2007 22:15:18 +0000 (23:15 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:50:30 +0000 (05:50 +0100)
source/utils/ntlm_auth.c

index b224689d7073b78429df45891e6b97724c63adf8..3144fe91b1033e4b83b0dc0a87e230553c0e83e9 100644 (file)
@@ -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;
 }