...so that they can hold the terminating '\0' in C strings.
Found with clang's -fsanitize=address while debugging
RawTherapee 5.8 crashers.
Later found to be already fixed upstream here:
de954c9529
Not handed in for maintainer approval because obviously correct,
maintainer will be notified though.
12 lines
327 B
C++
12 lines
327 B
C++
--- libs/lensfun/mount.cpp.orig 2018-06-29 10:29:17 UTC
|
|
+++ 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);
|
|
|