diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-04-16 16:31:51 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-04-16 16:31:51 +0300 |
commit | dcb443416e09a95f41693e1d5030867f5278e08f (patch) | |
tree | 331c1a156b87f295cfcf4658fa89e0400f2fe6ea /source/blender/blenloader/intern | |
parent | 3ea4d3dc07311a5799f7102a1e4f5920db367c0e (diff) |
Fix memcpy overlapping buffers
This crashes with ASAN enabled.
```
==39366==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x6230000ae848,0x6230000ae85a) and [0x6230000ae851, 0x6230000ae863) overlap
```
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index d53b6cde4ae..7904e51a516 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -4410,10 +4410,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ColorManagedViewSettings *view_settings; view_settings = &scene->view_settings; if (BLI_str_startswith(view_settings->look, "Filmic - ")) { - STRNCPY(view_settings->look, view_settings->look + strlen("Filmic - ")); + char *src = view_settings->look + strlen("Filmic - "); + memmove(view_settings->look, src, strlen(src) + 1); } else if (BLI_str_startswith(view_settings->look, "Standard - ")) { - STRNCPY(view_settings->look, view_settings->look + strlen("Standard - ")); + char *src = view_settings->look + strlen("Standard - "); + memmove(view_settings->look, src, strlen(src) + 1); } } |