From 5cf7947ccd1fc56e8944c28145a9c8e71f5e1a03 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Fri, 12 Jan 2024 23:50:28 +0000 Subject: [PATCH] 8323562: SaslInputStream.read() may return wrong value Co-authored-by: Aleksey Shipilev Reviewed-by: shade, dfuchs --- .../share/classes/com/sun/jndi/ldap/sasl/SaslInputStream.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslInputStream.java b/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslInputStream.java index f0746c103bc..534f7dac766 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslInputStream.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,7 @@ public class SaslInputStream extends InputStream { byte[] inBuf = new byte[1]; int count = read(inBuf, 0, 1); if (count > 0) { - return inBuf[0]; + return inBuf[0] & 0xff; } else { return -1; }