]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
subscribefunc: ensure we have an address to (un)subscribe
authorBaptiste Daroussin <bapt@FreeBSD.org>
Tue, 17 Sep 2024 14:14:14 +0000 (16:14 +0200)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Tue, 17 Sep 2024 14:14:14 +0000 (16:14 +0200)
src/subscriberfuncs.c

index f197b731ab5f7e0e214e47d77d750cde47e739b9..60b9cd6d5d65878a0fe494094cef582a22c5f738 100644 (file)
@@ -655,6 +655,9 @@ do_subscribe(struct ml *ml, struct subscription *sub, const char *addr)
                sub->reasonsub = SUB_PERMIT;
        }
 
+       if (address == NULL)
+               errx(EXIT_FAILURE, "No address to subscribe found");
+
        if(strncasecmp(ml->addr, address, strlen(ml->addr)) == 0)
                errx(EXIT_FAILURE, "Cannot subscribe the list address to the list");