From fe179ae0cb8fbce1cf86521e744c384553e515f2 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Tue, 12 Mar 2024 18:59:13 +0100 Subject: fix stackoverflow in deep searches --- src/unix/main_unix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/unix/main_unix.cpp') diff --git a/src/unix/main_unix.cpp b/src/unix/main_unix.cpp index 08087b6..94e7681 100644 --- a/src/unix/main_unix.cpp +++ b/src/unix/main_unix.cpp @@ -265,7 +265,7 @@ void ts_platform_list_files_block(ts_search_result* result, wchar_t* start_dir) if ((strcmp(dir->d_name, ".") == 0) || (strcmp(dir->d_name, "..") == 0)) continue; - utf8_int8_t complete_file_path[MAX_INPUT_LENGTH]; + utf8_int8_t* complete_file_path = (utf8_int8_t*)ts_memory_bucket_reserve(&result->memory, MAX_INPUT_LENGTH); strcpy(complete_file_path, search_dir); strcat(complete_file_path, "/"); strcat(complete_file_path, dir->d_name); @@ -283,7 +283,7 @@ void ts_platform_list_files_block(ts_search_result* result, wchar_t* start_dir) (void)matched_filter; - utf8_int8_t complete_file_path[MAX_INPUT_LENGTH]; + utf8_int8_t* complete_file_path = (utf8_int8_t*)ts_memory_bucket_reserve(&result->memory, MAX_INPUT_LENGTH); strcpy(complete_file_path, search_dir); strcat(complete_file_path, "/"); strcat(complete_file_path, dir->d_name); -- cgit v1.2.3-70-g09d2