--- /Metaphone.java	2023-07-05 03:06:53.426036864 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/language/Metaphone.java	2023-07-05 03:06:53.426036864 +0200
@@ -327,7 +327,7 @@
 
 	private boolean isNextChar(StringBuffer string, int index, char c) {
 		boolean matches = false;
-		if( index >= 0 &&
+if  (  ( index > 0 )  &&  ( index <  ( string.length (  )  )  )  )  {     matches =  ( string.charAt (  ( index - 1 )  )  )  == c; }
 		    index < string.length() - 1 ) {
 			matches = string.charAt(index + 1) == c;
 		}
