From 248bf17de8a25c741393b28e75c4e5380947792c Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 24 Oct 2026 05:27:59 +0200 Subject: Use new ranged unsigned int scanner everywhere and squash some bugs along the way --- ot_http.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ot_http.c') diff --git a/ot_http.c b/ot_http.c index 69bbc8e..626547b 100644 --- a/ot_http.c +++ b/ot_http.c @@ -18,7 +18,6 @@ #include "array.h" #include "iob.h" #include "ip6.h" -#include "scan.h" /* Opentracker */ #include "ot_accesslist.h" @@ -26,6 +25,7 @@ #include "ot_http.h" #include "ot_iovec.h" #include "ot_mutex.h" +#include "ot_scan.h" #include "ot_stats.h" #include "scan_urlencoded_query.h" #include "trackerlogic.h" @@ -618,6 +618,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct * // if( accesslist_is_blessed( cookie->ip, OT_PERMISSION_MAY_STAT ) ) { char *tmp_buf = ws->reply; ot_net net; + uint64_t value; signed short parsed, bits; len = scan_urlencoded_query(&read_ptr, tmp_buf, SCAN_SEARCHPATH_VALUE); @@ -634,9 +635,10 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct * if (tmp_buf[parsed++] != '/') bits = 128; else { - parsed = scan_short(tmp_buf + parsed, &bits); + parsed = scan_udec(tmp_buf + parsed, &value, 128); if (!parsed) HTTPERROR_400_PARAM; + bits = (signed short)value; if (ip6_isv4mapped(net.address)) bits += 96; } -- cgit v1.3