Fix potential buffer overflow with BLI_path_slash_ensure use
BLI_path_slash_ensure was appending to fixed sized buffers without a size check.
This commit is contained in:
@@ -182,7 +182,7 @@ static void seq_disk_cache_get_files(SeqDiskCache *disk_cache, char *path)
|
||||
if (is_dir && !FILENAME_IS_CURRPAR(file)) {
|
||||
char subpath[FILE_MAX];
|
||||
BLI_strncpy(subpath, fl->path, sizeof(subpath));
|
||||
BLI_path_slash_ensure(subpath);
|
||||
BLI_path_slash_ensure(subpath, sizeof(sizeof(subpath)));
|
||||
seq_disk_cache_get_files(disk_cache, subpath);
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ static void seq_disk_cache_delete_invalid_files(SeqDiskCache *disk_cache,
|
||||
DiskCacheFile *next_file, *cache_file = disk_cache->files.first;
|
||||
char cache_dir[FILE_MAX];
|
||||
seq_disk_cache_get_dir(disk_cache, scene, seq, cache_dir, sizeof(cache_dir));
|
||||
BLI_path_slash_ensure(cache_dir);
|
||||
BLI_path_slash_ensure(cache_dir, sizeof(cache_dir));
|
||||
|
||||
while (cache_file) {
|
||||
next_file = cache_file->next;
|
||||
|
||||
Reference in New Issue
Block a user