From 95e28034c3b4ca00e1fc7d440d153ccf55af6507 Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Wed, 12 Oct 2016 16:13:18 +0200 Subject: [PATCH] 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 --- src/scheme-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scheme-file.c b/src/scheme-file.c index dfe366f..cfbf530 100644 --- a/src/scheme-file.c +++ b/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)) ) {