diff --git a/lib/Horde/String.php b/lib/Horde/String.php index 9e6e16b0..7f5df398 100644 --- a/lib/Horde/String.php +++ b/lib/Horde/String.php @@ -870,6 +870,9 @@ public static function validUtf8($text) } do { + if($i + 1 >= $len) { + return false; + } $c = ord($text[++$i]); if (($c < 128) || ($c > 191)) { return false;