From: Daniel Salzman Date: Thu, 12 Jan 2023 07:49:32 +0000 (+0100) Subject: mod-geoip: mute UBSAN warning 'variable length array bound evaluates to non-positive... X-Git-Tag: v3.4.dev~260 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8d85f64fe0be551ea24b58ce6ea8f66fb8ad2cd;p=thirdparty%2Fknot-dns.git mod-geoip: mute UBSAN warning 'variable length array bound evaluates to non-positive value 0' --- diff --git a/src/knot/modules/geoip/geoip.c b/src/knot/modules/geoip/geoip.c index 1d96e0662f..4a8a2e345d 100644 --- a/src/knot/modules/geoip/geoip.c +++ b/src/knot/modules/geoip/geoip.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 CZ.NIC, z.s.p.o. +/* Copyright (C) 2023 CZ.NIC, z.s.p.o. 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 };