Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-09-07 20:21:12 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-09-07 20:23:11 +0300
commit9de20963cd6eddf1ef1e3d3ec5ee65d537af4b04 (patch)
treeee9fee9b47946e9f8da29402e21210414f714e71
parent04e12c617dc37e89cb73f3f69c238ae19ac351b2 (diff)
Fix beautiful textbook case of string overflow in `BLI_testextensie_glob`...
-rw-r--r--source/blender/blenlib/intern/path_util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 3a73d4cc0c7..656657aae12 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1610,16 +1610,16 @@ bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
while (ext_step[0]) {
const char *ext_next;
- int len_ext;
+ size_t len_ext;
if ((ext_next = strchr(ext_step, ';'))) {
- len_ext = (int)(ext_next - ext_step) + 1;
+ len_ext = ext_next - ext_step + 1;
}
else {
len_ext = sizeof(pattern);
}
- BLI_strncpy(pattern, ext_step, len_ext);
+ len_ext = BLI_strncpy_rlen(pattern, ext_step, len_ext);
if (fnmatch(pattern, str, FNM_CASEFOLD) == 0) {
return true;