]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
mod-geoip: mute UBSAN warning 'variable length array bound evaluates to non-positive...
authorDaniel Salzman <daniel.salzman@nic.cz>
Thu, 12 Jan 2023 07:49:32 +0000 (08:49 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Thu, 12 Jan 2023 12:49:02 +0000 (13:49 +0100)
src/knot/modules/geoip/geoip.c

index 1d96e0662fd598212214146d8c56747d72d38dc2..4a8a2e345d33cbc7167485c8fb63cba952bdc7b6 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2022 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -876,7 +876,7 @@ static knotd_in_state_t geoip_process(knotd_in_state_t state, knot_pkt_t *pkt,
        }
 
        uint16_t netmask = 0;
-       geodb_data_t entries[ctx->path_count];
+       geodb_data_t entries[GEODB_MAX_DEPTH];
 
        // Create dummy view and fill it with data about the current remote.
        geo_view_t dummy = { 0 };