提交 cd4c388f 编写于 作者: W weijun

8007761: NTLM coding errors

Reviewed-by: chegar
上级 91443882
...@@ -138,8 +138,7 @@ public final class Client extends NTLM { ...@@ -138,8 +138,7 @@ public final class Client extends NTLM {
domain = domainFromServer; domain = domainFromServer;
} }
if (domain == null) { if (domain == null) {
throw new NTLMException(NTLMException.NO_DOMAIN_INFO, domain = "";
"No domain info");
} }
int flags = 0x88200 | (inputFlags & 3); int flags = 0x88200 | (inputFlags & 3);
......
...@@ -136,10 +136,10 @@ class NTLM { ...@@ -136,10 +136,10 @@ class NTLM {
int readInt(int offset) throws NTLMException { int readInt(int offset) throws NTLMException {
try { try {
return internal[offset] & 0xff + return (internal[offset] & 0xff) +
(internal[offset+1] & 0xff << 8) + ((internal[offset+1] & 0xff) << 8) +
(internal[offset+2] & 0xff << 16) + ((internal[offset+2] & 0xff) << 16) +
(internal[offset+3] & 0xff << 24); ((internal[offset+3] & 0xff) << 24);
} catch (ArrayIndexOutOfBoundsException ex) { } catch (ArrayIndexOutOfBoundsException ex) {
throw new NTLMException(NTLMException.PACKET_READ_ERROR, throw new NTLMException(NTLMException.PACKET_READ_ERROR,
"Input message incorrect size"); "Input message incorrect size");
...@@ -148,8 +148,8 @@ class NTLM { ...@@ -148,8 +148,8 @@ class NTLM {
int readShort(int offset) throws NTLMException { int readShort(int offset) throws NTLMException {
try { try {
return internal[offset] & 0xff + return (internal[offset] & 0xff) +
(internal[offset+1] & 0xff << 8); ((internal[offset+1] & 0xff << 8));
} catch (ArrayIndexOutOfBoundsException ex) { } catch (ArrayIndexOutOfBoundsException ex) {
throw new NTLMException(NTLMException.PACKET_READ_ERROR, throw new NTLMException(NTLMException.PACKET_READ_ERROR,
"Input message incorrect size"); "Input message incorrect size");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册