--- john-1.7.6/src/rules.c.orig 2010-02-26 01:03:44 +0000 +++ john-1.7.6/src/rules.c 2011-03-20 01:33:41 +0000 @@ -905,6 +905,8 @@ char *rules_apply(char *word, char *rule out_OK: in[rules_max_length] = 0; if (last) { + if (length > rules_max_length) + length = rules_max_length; if (length >= ARCH_SIZE - 1) { if (*(ARCH_WORD *)in != *(ARCH_WORD *)last) return in;