openssl/openssl

win32_joiner() in crypto/dso/dso_win32.c writes 1 byte past the allocation when the directory has no trailing separator and file is NULL

Open

#31260 opened on May 20, 2026

View on GitHub
 (2 comments) (0 reactions) (0 assignees)C (30,157 stars) (11,262 forks)batch import
branch: 3.0branch: 3.4branch: 3.5branch: 3.6branch: 4.0good first issuetriaged: bug

Description

In win32_joiner() (crypto/dso/dso_win32.c), the directory trailing-separator is budgeted into len only when file_split->file is non-NULL but is emitted unconditionally by the directory loop; when dir is set without a trailing separator and file == NULL, the final result[offset] = '\0' writes one byte past OPENSSL_malloc(len + 1).

Contributor guide