Fix: Relative "Temporary Files" preference cause trouble (can crash) #118856

Closed
Philipp Oeser wants to merge 1 commits from lichtwerk/blender:95411 into blender-v4.1-release

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 1 additions and 1 deletions

View File

@ -1121,7 +1121,7 @@ static void where_is_temp(char *tempdir, const size_t tempdir_maxncpy, const cha
tempdir[0] = '\0';
if (userdir && userdir[0] != '\0' && BLI_is_dir(userdir)) {
if (userdir && userdir[0] != '\0' && BLI_is_dir(userdir) && !BLI_path_is_rel(userdir)) {
Review

This check should be added to BLI_temp_directory_path_get where "//" values could be passed in via environment variables.

This check should be added to `BLI_temp_directory_path_get` where "//" values could be passed in via environment variables.
BLI_strncpy(tempdir, userdir, tempdir_maxncpy);
/* Add a trailing slash if needed. */
BLI_path_slash_ensure(tempdir, tempdir_maxncpy);