Fix endless loop in ObjectChecker for MacOS

Bug: 477090
Change-Id: I0ba416f1cc172a835dd2723ff7fa904597ffd097
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Christian Halstrick 2015-09-17 16:11:39 +02:00 committed by Matthias Sohn
parent 868899982b
commit f4596284a0
2 changed files with 13 additions and 1 deletions

View File

@ -1809,6 +1809,17 @@ public void testRejectSpaceAtEndOnWindows() {
}
}
@Test
public void testBug477090() throws CorruptObjectException {
checker.setSafeForMacOS(true);
final byte[] bytes = {
// U+221E 0xe2889e INFINITY
(byte) 0xe2, (byte) 0x88, (byte) 0x9e,
// .html
0x2e, 0x68, 0x74, 0x6d, 0x6c };
checker.checkPathSegment(bytes, 0, bytes.length);
}
@Test
public void testRejectDotAtEndOnWindows() {
checker.setSafeForWindows(true);

View File

@ -618,8 +618,9 @@ private static boolean isMacHFSGit(byte[] raw, int ptr, int end)
default:
return false;
}
default:
return false;
}
break;
case (byte) 0xef: // http://www.utf8-chartable.de/unicode-utf8-table.pl?start=65024
checkTruncatedIgnorableUTF8(raw, ptr, end);
// U+FEFF 0xefbbbf ZERO WIDTH NO-BREAK SPACE