← Commit list

ea75ccc53b

Daniel Stenberg
Daniel Stenberg
2026-05-10
SUCCESS Duration: 221s

Subject

schannel_verify: avoid out of blob access

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/vtls/schannel_verify.c+3 -7
@@ -92,11 +92,6 @@ struct cert_chain_engine_config_win7 {
HCERTSTORE hExclusiveTrustedPeople;
};
-static int is_cr_or_lf(char c)
-{
- return c == '\r' || c == '\n';
-}
-
/* Search the substring needle,needlelen into string haystack,haystacklen
* Strings do not need to be terminated by a '\0'.
* Similar of macOS/Linux memmem (not available on Visual Studio).
@@ -134,10 +129,11 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store,
while(more_certs && (current_ca_file_ptr < ca_buffer_limit)) {
const char *begin_cert_ptr = c_memmem(current_ca_file_ptr,
- ca_buffer_limit-current_ca_file_ptr,
+ ca_buffer_limit -
+ current_ca_file_ptr - 1,
BEGIN_CERT,
begin_cert_len);
- if(!begin_cert_ptr || !is_cr_or_lf(begin_cert_ptr[begin_cert_len])) {
+ if(!begin_cert_ptr || !ISNEWLINE(begin_cert_ptr[begin_cert_len])) {
more_certs = 0;
}
else {