提交 efba85b0 编写于 作者: I igerasim

8134297: NPE in GSSNameElement nameType check

Reviewed-by: xuelei
上级 7ebdb0fe
...@@ -159,7 +159,9 @@ public class GSSNameElement implements GSSNameSpi { ...@@ -159,7 +159,9 @@ public class GSSNameElement implements GSSNameSpi {
int atPos = krbName.lastIndexOf('@'); int atPos = krbName.lastIndexOf('@');
if (atPos != -1) { if (atPos != -1) {
String atRealm = krbName.substring(atPos); String atRealm = krbName.substring(atPos);
if (nameType.equals(GSSUtil.NT_GSS_KRB5_PRINCIPAL) // getNativeNameType() can modify NT_GSS_KRB5_PRINCIPAL to null
if ((nameType == null
|| nameType.equals(GSSUtil.NT_GSS_KRB5_PRINCIPAL))
&& new String(nameBytes).endsWith(atRealm)) { && new String(nameBytes).endsWith(atRealm)) {
// Created from Kerberos name with realm, no need to check // Created from Kerberos name with realm, no need to check
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册