From 41759cc993dab7e4fbddf17529e0d44511df4c07 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Tue, 17 Sep 2024 16:14:14 +0200 Subject: [PATCH] subscribefunc: ensure we have an address to (un)subscribe --- src/subscriberfuncs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/subscriberfuncs.c b/src/subscriberfuncs.c index f197b731..60b9cd6d 100644 --- a/src/subscriberfuncs.c +++ b/src/subscriberfuncs.c @@ -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"); -- 2.47.3