Browse Source

Ignore non-NULL zero-length authority

Commit 609ab3c introduced a regression in which local shares
could not be used because a non-NULL zero-length authority
string was compared to "localhost". The comparison should only
be attempted on a non-NULL, non-empty string.

Incenp-bug-id: 5
develop
Damien Goutte-Gattat 5 years ago
parent
commit
95e28034c3
  1. 2
      src/scheme-file.c

2
src/scheme-file.c

@ -38,7 +38,7 @@ gfsec_scheme_file_get_file(gfsec_scheme_t scheme,
if ( scheme != GFSEC_SCHEME_FILE )
return GFSEC_SCHEME_STATUS_UNSUPPORTED_SCHEME;
if ( authority && strcmp(authority, "localhost") != 0 )
if ( authority && *authority && strcmp(authority, "localhost") != 0 )
return GFSEC_SCHEME_STATUS_ERROR;
if ( (*buffer = read_file(path, len, GFSEC_SECRET_MAX_SIZE)) ) {

Loading…
Cancel
Save