Browse files

Fix off-by-1 in the utf8 validator

  • Loading branch information...
1 parent e2f52ec commit 41322deea57b7d1168ab6aaa0894cb4793c546a7 @jeremyevans committed Feb 27, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 c/apetag.c
View
3 c/apetag.c
@@ -1334,7 +1334,8 @@ static int ApeTag__check_valid_utf8(unsigned char *utf8_string, uint32_t size) {
return -1;
}
/* Check remaining bytes of character */
- for (c++; c <= utf_last_char; c++) {
+ for (; c + 1 <= utf_last_char;) {
+ c++;
if ((*c & 192) != 128) {
return -1;
}

0 comments on commit 41322de

Please sign in to comment.