]> git.ipfire.org Git - location/libloc.git/commitdiff
as: Do not attempt to match name when it wasn't set
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 21 Oct 2020 09:18:08 +0000 (09:18 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 21 Oct 2020 09:18:08 +0000 (09:18 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/as.c

index 8421ac8a341a091513f272e60546ef36805b0067..757bf3d3b742b19b29d426974beaf4813b953384 100644 (file)
--- a/src/as.c
+++ b/src/as.c
@@ -145,6 +145,10 @@ int loc_as_match_string(struct loc_as* as, const char* string) {
        if (!string)
                return 1;
 
+       // Cannot match anything when name is not set
+       if (!as->name)
+               return 1;
+
        // Search if string is in name
        if (strcasestr(as->name, string) != NULL)
                return 1;