Index: rules.c =================================================================== RCS file: /home/cvs/cvsroot/Owl/packages/john/john/src/rules.c,v retrieving revision 1.30 diff -u -r1.30 rules.c --- rules.c 31 May 2016 07:11:51 -0000 1.30 +++ rules.c 8 Jul 2016 13:16:19 -0000 @@ -1,6 +1,6 @@ /* * This file is part of John the Ripper password cracker, - * Copyright (c) 1996-99,2003,2005,2009,2010,2015 by Solar Designer + * Copyright (c) 1996-99,2003,2005,2009,2010,2015,2016 by Solar Designer */ #include @@ -349,7 +349,7 @@ in = buffer[2]; length = 0; - while (length < RULE_WORD_SIZE - 1) { + while (length < RULE_WORD_SIZE) { if (!(in[length] = word[length])) break; length++; @@ -378,7 +378,8 @@ which = 0; while (RULE) { - in[RULE_WORD_SIZE - 1] = 0; + if (length >= RULE_WORD_SIZE) + in[length = RULE_WORD_SIZE - 1] = 0; switch (LAST) { /* Crack 4.1 rules */