Skip to content

Commit ca73a0b

Browse files
muhomorrthestinger
authored andcommitted
fix an upstream infinite loop bug in ProtoFieldFilter.skipBytes()
1 parent 664969b commit ca73a0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/java/android/util/proto/ProtoFieldFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ private void skipBytes(InputStream in, long n) throws IOException {
307307
while (bytesRemaining > 0) {
308308
int bytesToRead = (int) Math.min(bytesRemaining, mBuffer.length);
309309
int bytesRead = in.read(mBuffer, 0, bytesToRead);
310-
if (bytesRemaining < 0) {
310+
if (bytesRead < 0) {
311311
throw new IOException("EOF while skipping bytes");
312312
}
313313
bytesRemaining -= bytesRead;

0 commit comments

Comments
 (0)