commit d58eff2d1ad707389a8da88787eb5415381786f0 Author: magnum Date: Sun Aug 5 15:20:39 2012 +0200 wordlist.c: fix segfault reported in http://www.openwall.com/lists/john-users/2012/08/01/5 diff --git a/src/wordlist.c b/src/wordlist.c index 18f6106..6013bb3 100644 --- a/src/wordlist.c +++ b/src/wordlist.c @@ -509,6 +509,9 @@ void do_wordlist_crack(struct db_main *db, char *name, int rules) i = 0; cp = word_file_str; + if (csearch == '\n') + while (*cp == '\r') cp++; + if (dupeCheck) { hash_log = 1; while (((1 << hash_log) < (nWordFileLines)) @@ -557,6 +560,7 @@ void do_wordlist_crack(struct db_main *db, char *name, int rules) } cp = ep + 1; if (ec == '\r' && *cp == '\n') cp++; + if (ec == '\n' && *cp == '\r') cp++; } while (cp < aep); if (nWordFileLines - i) log_event("- suppressed %u duplicate lines and/or comments from wordlist.", nWordFileLines - i);