# HG changeset patch # User coffeys # Date 1470826452 -3600 # Node ID 0222e4232e7cdb390d1c9fafb92aafce00befa0f # Parent a68a0f6758df618fa1b8bc24b93e37d10dc07886 8163104: Unexpected NPE still possible on some Kerberos ticket calls Reviewed-by: weijun diff -r a68a0f6758df -r 0222e4232e7c jdk/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java --- a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java Tue Aug 09 22:31:41 2016 -0700 +++ b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java Wed Aug 10 11:54:12 2016 +0100 @@ -235,8 +235,11 @@ */ public int getInitLifetime() throws GSSException { int retVal = 0; - retVal = (int)(getEndTime().getTime() - - (new Date().getTime())); + Date d = getEndTime(); + if (d == null) { + return 0; + } + retVal = (int)(d.getTime() - (new Date().getTime())); return retVal/1000; }