From 1b909c726bdb76b8e9847a37339ac023bd26e580 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Tue, 18 May 2021 16:15:08 +0200 Subject: Fix build warning Value of the size argument in `strncat` is too large, might lead to a buffer overflow. Change the argument to be the free space in the destination buffer minus the terminating null byte. Introduced in 5368859a669d Reviewed By: Sergey Differential Revision: https://developer.blender.org/D11289 --- source/blender/sequencer/intern/image_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/sequencer') diff --git a/source/blender/sequencer/intern/image_cache.c b/source/blender/sequencer/intern/image_cache.c index 7b873d5c66e..a0c95c1c197 100644 --- a/source/blender/sequencer/intern/image_cache.c +++ b/source/blender/sequencer/intern/image_cache.c @@ -361,7 +361,7 @@ static void seq_disk_cache_get_project_dir(SeqDiskCache *disk_cache, char *path, BLI_split_file_part(BKE_main_blendfile_path(disk_cache->bmain), cache_dir, sizeof(cache_dir)); /* Use suffix, so that the cache directory name does not conflict with the bmain's blend file. */ const char *suffix = "_seq_cache"; - strncat(cache_dir, suffix, sizeof(cache_dir) - strlen(cache_dir)); + strncat(cache_dir, suffix, sizeof(cache_dir) - strlen(cache_dir) - 1); BLI_strncpy(path, seq_disk_cache_base_dir(), path_len); BLI_path_append(path, path_len, cache_dir); } -- cgit v1.2.3