From 1b2ce2945483283a9e3f5d8561bedcfde2559704 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 3 Aug 2024 22:40:02 +0200 Subject: [PATCH] Fix value overflow in get_top_upstreams() due to in_port_t being an unsigned 16 bit integer where we need a signed data type. This is a regression of #2001 Signed-off-by: DL6ER --- src/api/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/stats.c b/src/api/stats.c index 18227e3c..fcfa02a6 100644 --- a/src/api/stats.c +++ b/src/api/stats.c @@ -570,7 +570,7 @@ cJSON *get_top_upstreams(struct ftl_conn *api, const bool upstreams_only) { int count = 0; const char* ip, *name; - in_port_t port = -1; + int port = -1; // Need signed data type here as -1 means: no port applicable double responsetime = 0.0, uncertainty = 0.0; if(i == -2)