From 89f05cf116ef15089abb151bb672a02fe679c088 Mon Sep 17 00:00:00 2001 From: Zipeng WU Date: Thu, 10 Dec 2020 10:03:37 +0100 Subject: InputSteam.read() implementation should not return a signed byte --- .../src/main/java/org/sonar/db/ce/LogsIteratorInputStream.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/ce/LogsIteratorInputStream.java b/server/sonar-db-dao/src/main/java/org/sonar/db/ce/LogsIteratorInputStream.java index bef33c06cb5..70d73ed25b2 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/ce/LogsIteratorInputStream.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/ce/LogsIteratorInputStream.java @@ -55,7 +55,9 @@ final class LogsIteratorInputStream extends InputStream { return END_OF_STREAM; } } - return buf[nextChar++]; + byte signedByte = buf[nextChar]; + nextChar++; + return signedByte & 0xFF; } private void fill() { -- cgit v1.2.3