Permalink
Browse files

Fixed a NullPointerException case on Digest authentication.

Could occur when upgrading from a Debian package configured with Basic
authentication (as in release 1.92.9000) to a more recent one with
Digest authentication, without having re-encoded the admin password (for
example with dpkg-reconfigure).

As reported by eros on YaCy forum
(http://forum.yacy-websuche.de/viewtopic.php?f=23&t=5988#p33686).
  • Loading branch information...
luccioman committed May 29, 2017
1 parent b65a040 commit aa55d71cf53ccca0f985706983423fac82852f49
Showing with 5 additions and 2 deletions.
  1. +5 −2 source/net/yacy/http/YaCyLegacyCredential.java
@@ -65,8 +65,11 @@ public static String calcHash(String pw) { // old style hash
public boolean check(Object credentials) {
if (credentials instanceof Credential) { // for DIGEST auth
return ((Credential) credentials).check(c);
if(this.c == null) {
/* credential may be null after switching from BASIC to DIGEST authentication without re-encoding the password */
return false;
}
return ((Credential) credentials).check(this.c);
}
if (credentials instanceof String) { // for BASIC auth
final String pw = (String) credentials;

0 comments on commit aa55d71

Please sign in to comment.