vendor : update cpp-httplib to 0.43.4 (#22888)

This commit is contained in:
Alessandro de Oliveira Faria (A.K.A.CABELO)
2026-05-10 13:46:54 -03:00
committed by GitHub
parent 2b2babd124
commit 5d5d2e15d2
3 changed files with 20 additions and 8 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ import os
import sys import sys
import subprocess import subprocess
HTTPLIB_VERSION = "refs/tags/v0.43.3" HTTPLIB_VERSION = "refs/tags/v0.43.4"
vendor = { vendor = {
"https://github.com/nlohmann/json/releases/latest/download/json.hpp": "vendor/nlohmann/json.hpp", "https://github.com/nlohmann/json/releases/latest/download/json.hpp": "vendor/nlohmann/json.hpp",
+17 -5
View File
@@ -8980,10 +8980,22 @@ ssize_t ChunkedDecoder::read_payload(char *buf, size_t len,
stream_line_reader lr(strm, line_buf, sizeof(line_buf)); stream_line_reader lr(strm, line_buf, sizeof(line_buf));
if (!lr.getline()) { return -1; } if (!lr.getline()) { return -1; }
char *endptr = nullptr; // RFC 9112 §7.1: chunk-size = 1*HEXDIG
unsigned long chunk_len = std::strtoul(lr.ptr(), &endptr, 16); const char *p = lr.ptr();
if (endptr == lr.ptr()) { return -1; } int v = 0;
if (chunk_len == ULONG_MAX) { return -1; } if (!is_hex(*p, v)) { return -1; }
size_t chunk_len = 0;
constexpr size_t chunk_len_max = (std::numeric_limits<size_t>::max)();
for (; is_hex(*p, v); ++p) {
if (chunk_len > (chunk_len_max >> 4)) { return -1; }
chunk_len = (chunk_len << 4) | static_cast<size_t>(v);
}
while (is_space_or_tab(*p)) {
++p;
}
if (*p != '\0' && *p != ';' && *p != '\r' && *p != '\n') { return -1; }
if (chunk_len == 0) { if (chunk_len == 0) {
chunk_remaining = 0; chunk_remaining = 0;
@@ -8993,7 +9005,7 @@ ssize_t ChunkedDecoder::read_payload(char *buf, size_t len,
return 0; return 0;
} }
chunk_remaining = static_cast<size_t>(chunk_len); chunk_remaining = chunk_len;
last_chunk_total = chunk_remaining; last_chunk_total = chunk_remaining;
last_chunk_offset = 0; last_chunk_offset = 0;
} }
+2 -2
View File
@@ -8,8 +8,8 @@
#ifndef CPPHTTPLIB_HTTPLIB_H #ifndef CPPHTTPLIB_HTTPLIB_H
#define CPPHTTPLIB_HTTPLIB_H #define CPPHTTPLIB_HTTPLIB_H
#define CPPHTTPLIB_VERSION "0.43.3" #define CPPHTTPLIB_VERSION "0.43.4"
#define CPPHTTPLIB_VERSION_NUM "0x002b03" #define CPPHTTPLIB_VERSION_NUM "0x002b04"
#ifdef _WIN32 #ifdef _WIN32
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0A00 #if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0A00