diff -urpN john-1.7.7-jumbo-5-RC4/src/Makefile john-1.7.7-jumbo-5-RC4-utf8-fixes/src/Makefile
--- john-1.7.7-jumbo-5-RC4/src/Makefile	2011-05-17 16:13:01.000000000 +0000
+++ john-1.7.7-jumbo-5-RC4-utf8-fixes/src/Makefile	2011-05-18 07:32:50.000000000 +0000
@@ -157,8 +157,9 @@ default:
 	@echo "linux-x86-64-xop         Linux, x86-64 with AVX and XOP (experimental)"
 	@echo "linux-x86-64-icc         Linux, x86-64 compiled with icc (best)"
 	@echo "linux-x86-64-clang       Linux, x86-64 compiled with clang (good)"
-	@echo "linux-x86-64-32-sse2     Linux, x86-64, 32-bit with SSE2"
-#	@echo "linux-x86-64-32-mmx      Linux, x86-64, 32-bit with MMX"
+#	@echo "linux-x86-64-32-sse2     Linux, x86-64, 32-bit with SSE2 (for regression tests)"
+#	@echo "linux-x86-64-32-mmx      Linux, x86-64, 32-bit with MMX (for regression tests)"
+#	@echo "linux-x86-64-32-any      Linux, x86-64, 32-bit (for regression tests)"
 	@echo "linux-x86-sse2           Linux, x86 32-bit with SSE2 (best tested if 32-bit)"
 	@echo "linux-x86-sse2i          Linux, x86 32-bit with SSE2 (32-bit, intrinsic)"
 	@echo "linux-x86-mmx            Linux, x86 32-bit with MMX (for old computers)"
@@ -285,6 +286,14 @@ linux-x86-64-32-mmx:
 		CFLAGS="$(CFLAGS) -m32 -DHAVE_CRYPT" \
 		ASFLAGS="$(ASFLAGS) -m32" \
 		LDFLAGS="$(LDFLAGS) -m32 -lcrypt"
+
+linux-x86-64-32-any:
+	$(LN) x86-any.h arch.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) c3_fmt.o x86.o" \
+		CFLAGS="$(CFLAGS) -m32 -DHAVE_CRYPT" \
+		ASFLAGS="$(ASFLAGS) -m32" \
+		LDFLAGS="$(LDFLAGS) -m32 -lcrypt"
 
 linux-x86-sse2:
 	$(LN) x86-sse.h arch.h
diff -urpN john-1.7.7-jumbo-5-RC4/src/mscash_fmt.c john-1.7.7-jumbo-5-RC4-utf8-fixes/src/mscash_fmt.c
--- john-1.7.7-jumbo-5-RC4/src/mscash_fmt.c	2011-05-17 21:06:12.000000000 +0000
+++ john-1.7.7-jumbo-5-RC4-utf8-fixes/src/mscash_fmt.c	2011-05-18 07:32:50.000000000 +0000
@@ -782,12 +782,12 @@ static inline void set_key_helper_utf8(u
 		target += xBuf;
 	}
 
-	while(target < &keybuffer[*lastlen * xBuf]) {
+	while(target < &keybuffer[*lastlen]) {
 		*target = 0;
 		target += xBuf;
 	}
 
-	*lastlen = outlen;
+	*lastlen = ((outlen >> 1) + 1) * xBuf;
 	keybuffer[lenStoreOffset] = outlen << 4;
 }
 
diff -urpN john-1.7.7-jumbo-5-RC4/src/NT_fmt.c john-1.7.7-jumbo-5-RC4-utf8-fixes/src/NT_fmt.c
--- john-1.7.7-jumbo-5-RC4/src/NT_fmt.c	2011-05-17 16:02:55.000000000 +0000
+++ john-1.7.7-jumbo-5-RC4-utf8-fixes/src/NT_fmt.c	2011-05-18 07:32:50.000000000 +0000
@@ -778,12 +778,12 @@ static inline void set_key_helper_utf8(u
 		target += xBuf;
 	}
 
-	while(target < &keybuffer[*lastlen * xBuf]) {
+	while(target < &keybuffer[*lastlen]) {
 		*target = 0;
 		target += xBuf;
 	}
 
-	*lastlen = outlen;
+	*lastlen = ((outlen >> 1) + 1) * xBuf;
 	keybuffer[lenStoreOffset] = outlen << 4;
 }
 
diff -urpN john-1.7.7-jumbo-5-RC4/src/unicode.c john-1.7.7-jumbo-5-RC4-utf8-fixes/src/unicode.c
--- john-1.7.7-jumbo-5-RC4/src/unicode.c	2011-05-17 13:54:04.000000000 +0000
+++ john-1.7.7-jumbo-5-RC4-utf8-fixes/src/unicode.c	2011-05-18 07:32:50.000000000 +0000
@@ -286,7 +286,7 @@ inline unsigned int strlen16(const UTF16
  */
 int E_md4hash(const UTF8 * passwd, unsigned int len, unsigned char *p16)
 {
-	unsigned int trunclen;
+	int trunclen;
 	static UTF16 wpwd[PLAINTEXT_BUFFER_SIZE + 1];
 	if (len > 27) {
 		static MD4_CTX ctx;
