diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-24 05:27:59 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-24 05:27:59 +0200 |
| commit | 248bf17de8a25c741393b28e75c4e5380947792c (patch) | |
| tree | cc9e4b8bbe79f015bb9793968b021e10765008a6 /ot_http.c | |
| parent | 5fb172a50fc343ef642745b0ecb4b6a44d274b15 (diff) | |
Use new ranged unsigned int scanner everywhere and squash some bugs along the way
Diffstat (limited to 'ot_http.c')
| -rw-r--r-- | ot_http.c | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -18,7 +18,6 @@ | |||
| 18 | #include "array.h" | 18 | #include "array.h" |
| 19 | #include "iob.h" | 19 | #include "iob.h" |
| 20 | #include "ip6.h" | 20 | #include "ip6.h" |
| 21 | #include "scan.h" | ||
| 22 | 21 | ||
| 23 | /* Opentracker */ | 22 | /* Opentracker */ |
| 24 | #include "ot_accesslist.h" | 23 | #include "ot_accesslist.h" |
| @@ -26,6 +25,7 @@ | |||
| 26 | #include "ot_http.h" | 25 | #include "ot_http.h" |
| 27 | #include "ot_iovec.h" | 26 | #include "ot_iovec.h" |
| 28 | #include "ot_mutex.h" | 27 | #include "ot_mutex.h" |
| 28 | #include "ot_scan.h" | ||
| 29 | #include "ot_stats.h" | 29 | #include "ot_stats.h" |
| 30 | #include "scan_urlencoded_query.h" | 30 | #include "scan_urlencoded_query.h" |
| 31 | #include "trackerlogic.h" | 31 | #include "trackerlogic.h" |
| @@ -618,6 +618,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct * | |||
| 618 | // if( accesslist_is_blessed( cookie->ip, OT_PERMISSION_MAY_STAT ) ) { | 618 | // if( accesslist_is_blessed( cookie->ip, OT_PERMISSION_MAY_STAT ) ) { |
| 619 | char *tmp_buf = ws->reply; | 619 | char *tmp_buf = ws->reply; |
| 620 | ot_net net; | 620 | ot_net net; |
| 621 | uint64_t value; | ||
| 621 | signed short parsed, bits; | 622 | signed short parsed, bits; |
| 622 | 623 | ||
| 623 | len = scan_urlencoded_query(&read_ptr, tmp_buf, SCAN_SEARCHPATH_VALUE); | 624 | 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 * | |||
| 634 | if (tmp_buf[parsed++] != '/') | 635 | if (tmp_buf[parsed++] != '/') |
| 635 | bits = 128; | 636 | bits = 128; |
| 636 | else { | 637 | else { |
| 637 | parsed = scan_short(tmp_buf + parsed, &bits); | 638 | parsed = scan_udec(tmp_buf + parsed, &value, 128); |
| 638 | if (!parsed) | 639 | if (!parsed) |
| 639 | HTTPERROR_400_PARAM; | 640 | HTTPERROR_400_PARAM; |
| 641 | bits = (signed short)value; | ||
| 640 | if (ip6_isv4mapped(net.address)) | 642 | if (ip6_isv4mapped(net.address)) |
| 641 | bits += 96; | 643 | bits += 96; |
| 642 | } | 644 | } |
