Fix reading uninitialized memory finding paths
authorCampbell Barton <ideasman42@gmail.com>
Tue, 5 May 2015 16:22:00 +0000 (02:22 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 5 May 2015 16:22:00 +0000 (02:22 +1000)
source/blender/blenkernel/intern/bpath.c

index 7c2b0a8a84010c76b4ead2086f45a6e0a00b9362..265cb0aa403f514c452fff8841564df7391d6ae2 100644 (file)
@@ -370,6 +370,9 @@ static bool rewrite_path_fixed_dirfile(char path_dir[FILE_MAXDIR],
 
        BLI_join_dirfile(path_src, sizeof(path_src), path_dir, path_file);
 
+       /* so functions can check old value */
+       BLI_strncpy(path_dst, path_src, FILE_MAX);
+
        if (absbase) {
                BLI_path_abs(path_src, absbase);
        }