Last active
February 22, 2021 14:17
-
-
Save ktgw0316/1caee7326bb9cf9e191ff6267d3fe342 to your computer and use it in GitHub Desktop.
lensfun de954c9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/libs/lensfun/lens.cpp b/libs/lensfun/lens.cpp | |
| index 52b76658..ec99da4b 100644 | |
| --- a/libs/lensfun/lens.cpp | |
| +++ b/libs/lensfun/lens.cpp | |
| @@ -130,7 +130,7 @@ void lfLens::AddMount (const char *val) | |
| { | |
| if (val) | |
| { | |
| - char* p = (char*)malloc(strlen(val)); | |
| + char* p = (char*)malloc(strlen(val) + 1); | |
| strcpy(p, val); | |
| MountNames.push_back(p); | |
| diff --git a/libs/lensfun/mount.cpp b/libs/lensfun/mount.cpp | |
| index bd875baa..1df01dbe 100644 | |
| --- a/libs/lensfun/mount.cpp | |
| +++ b/libs/lensfun/mount.cpp | |
| @@ -60,7 +60,7 @@ void lfMount::AddCompat (const char *val) | |
| { | |
| if (val) | |
| { | |
| - char* p = (char*)malloc(strlen(val)); | |
| + char* p = (char*)malloc(strlen(val) + 1); | |
| strcpy(p, val); | |
| MountCompat.push_back(p); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment