vtls_scache: allocate absolute filename on heap (Windows)

To allow any full path lengths, beyond the 260 characters allowed by
`_MAX_PATH`.

Follow-up to fa0ccd9f1f #15774

Closes #22357
This commit is contained in:
Viktor Szakats 2026-07-20 17:34:20 +02:00
parent 703a999602
commit bd58857201
No known key found for this signature in database

View file

@ -76,9 +76,13 @@ static CURLcode cf_ssl_peer_key_add_path(struct dynbuf *buf,
* when used in another process with different CWD. When a path does not
* exist, this does not work. Then, we add the path as is. */
#ifdef _WIN32
char abspath[_MAX_PATH];
if(_fullpath(abspath, path, _MAX_PATH))
return curlx_dyn_addf(buf, ":%s-%s", name, abspath);
char *abspath = _fullpath(NULL, path, 0);
if(abspath) {
CURLcode result = curlx_dyn_addf(buf, ":%s-%s", name, abspath);
/* !checksrc! disable BANNEDFUNC 1 */
free(abspath); /* allocated by CRT, use system free() */
return result;
}
*is_local = TRUE;
#elif defined(HAVE_REALPATH)
if(path[0] != '/') {