]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: deviceatlas: add missing return on error in config parsers
authorDavid Carlier <dcarlier@deviceatlas.com>
Sat, 14 Feb 2026 13:23:55 +0000 (13:23 +0000)
committerWilly Tarreau <w@1wt.eu>
Sat, 14 Feb 2026 13:47:22 +0000 (14:47 +0100)
da_log_level() and da_cache_size() were missing a return -1 on error,
causing fall-through to the normal return 0 path when invalid values
were provided.

This should be backported to lower branches.

addons/deviceatlas/da.c

index 417fbf2f3ba8e96fbfd35091ec434c9f211a9f88..e9fb91d1a112ab74e6a95708e2be390131a760c4 100644 (file)
@@ -73,6 +73,7 @@ static int da_log_level(char **args, int section_type, struct proxy *curpx,
        loglevel = atol(args[1]);
        if (loglevel < 0 || loglevel > 3) {
                memprintf(err, "deviceatlas log level : expects a log level between 0 and 3, %s given.\n", args[1]);
+               return -1;
        } else {
                global_deviceatlas.loglevel = (da_severity_t)loglevel;
        }
@@ -119,6 +120,7 @@ static int da_cache_size(char **args, int section_type, struct proxy *curpx,
     cachesize = atol(args[1]);
     if (cachesize < 0 || cachesize > DA_CACHE_MAX) {
         memprintf(err, "deviceatlas cache size : expects a cache size between 0 and %d, %s given.\n", DA_CACHE_MAX, args[1]);
+       return -1;
     } else {
 #ifdef APINOCACHE
         fprintf(stdout, "deviceatlas cache size : no-op, its support is disabled.\n");