--- /DoubleMetaphone.java	2023-07-05 02:34:58.454155634 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/language/DoubleMetaphone.java	2023-07-05 02:34:58.458155632 +0200
@@ -145,7 +145,7 @@
                 break;
             case 'N':
                 result.append('N');
-                index = charAt(value, index + 1) == 'N' ? index + 2 : index + 1;
+index = charAt ( value, index + maxLength )  == 'N' ? index + 2 : index + maxLength;
                 break;
             case '\u00D1':
                 // N with a tilde (spanish ene)
