8246193: Possible NPE in ENC-PA-REP search in AS-REQ

Reviewed-by: xuelei
This commit is contained in:
Weijun Wang 2020-05-31 10:13:04 +08:00
parent 4eeb61299f
commit 6212aea580
3 changed files with 53 additions and 7 deletions

View file

@ -146,12 +146,14 @@ abstract class KrbKdcRep {
boolean reqPaReqEncPaRep = false;
boolean repPaReqEncPaRepValid = false;
for (PAData pa : req.pAData) {
if (pa.getType() == Krb5.PA_REQ_ENC_PA_REP) {
// The KDC supports RFC 6806 and ENC-PA-REP was sent in
// the request (AS-REQ). A valid checksum is now required.
reqPaReqEncPaRep = true;
break;
if (req.pAData != null) {
for (PAData pa : req.pAData) {
if (pa.getType() == Krb5.PA_REQ_ENC_PA_REP) {
// The KDC supports RFC 6806 and ENC-PA-REP was sent in
// the request (AS-REQ). A valid checksum is now required.
reqPaReqEncPaRep = true;
break;
}
}
}