Fix potential string buffer overruns.
authorBastien Montagne <montagne29@wanadoo.fr>
Sun, 8 Oct 2017 14:08:00 +0000 (16:08 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Sun, 8 Oct 2017 14:08:00 +0000 (16:08 +0200)
Note that our library path handling is still rather dodgy on this
regards, shall take some time at some point to seriously sanitize it...

source/blender/editors/space_file/file_ops.c
source/blender/windowmanager/intern/wm_files_link.c

index ab1bcbaa8b508ae084731f5594363fa727922828..22c1214d92852c4759830109cc33b96297ebad83 100644 (file)
@@ -2203,7 +2203,7 @@ static int file_rename_poll(bContext *C)
                        poll = false;
                }
                else {
-                       char dir[FILE_MAX];
+                       char dir[FILE_MAX_LIBEXTRA];
                        if (filelist_islibrary(sfile->files, dir, NULL)) {
                                poll = false;
                        }
@@ -2235,7 +2235,7 @@ static int file_delete_poll(bContext *C)
        SpaceFile *sfile = CTX_wm_space_file(C);
 
        if (sfile && sfile->params) {
-               char dir[FILE_MAX];
+               char dir[FILE_MAX_LIBEXTRA];
                int numfiles = filelist_files_ensure(sfile->files);
                int i;
                int num_selected = 0;
index f19c999a4f1f6495d705e916712efc1de6009316..7e6c6160b841e919c4a8a157a81c8b1ad12f9c9e 100644 (file)
@@ -282,7 +282,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
        Scene *scene = CTX_data_scene(C);
        PropertyRNA *prop;
        WMLinkAppendData *lapp_data;
-       char path[FILE_MAX_LIBEXTRA], root[FILE_MAXDIR], libname[FILE_MAX], relname[FILE_MAX];
+       char path[FILE_MAX_LIBEXTRA], root[FILE_MAXDIR], libname[FILE_MAX_LIBEXTRA], relname[FILE_MAX];
        char *group, *name;
        int totfiles = 0;
        short flag;