8007761: NTLM coding errors

Reviewed-by: chegar
This commit is contained in:
Weijun Wang 2013-02-09 16:43:58 +08:00
parent d8233ec657
commit 76953b4d1e
2 changed files with 7 additions and 8 deletions

View File

@ -138,8 +138,7 @@ public final class Client extends NTLM {
domain = domainFromServer;
}
if (domain == null) {
throw new NTLMException(NTLMException.NO_DOMAIN_INFO,
"No domain info");
domain = "";
}
int flags = 0x88200 | (inputFlags & 3);

View File

@ -136,10 +136,10 @@ class NTLM {
int readInt(int offset) throws NTLMException {
try {
return internal[offset] & 0xff +
(internal[offset+1] & 0xff << 8) +
(internal[offset+2] & 0xff << 16) +
(internal[offset+3] & 0xff << 24);
return (internal[offset] & 0xff) +
((internal[offset+1] & 0xff) << 8) +
((internal[offset+2] & 0xff) << 16) +
((internal[offset+3] & 0xff) << 24);
} catch (ArrayIndexOutOfBoundsException ex) {
throw new NTLMException(NTLMException.PACKET_READ_ERROR,
"Input message incorrect size");
@ -148,8 +148,8 @@ class NTLM {
int readShort(int offset) throws NTLMException {
try {
return internal[offset] & 0xff +
(internal[offset+1] & 0xff << 8);
return (internal[offset] & 0xff) +
((internal[offset+1] & 0xff << 8));
} catch (ArrayIndexOutOfBoundsException ex) {
throw new NTLMException(NTLMException.PACKET_READ_ERROR,
"Input message incorrect size");