aboutsummaryrefslogtreecommitdiff
path: root/graphics/lensfun
diff options
context:
space:
mode:
authorMatthias Andree <mandree@FreeBSD.org>2020-02-08 13:15:43 +0000
committerMatthias Andree <mandree@FreeBSD.org>2020-02-08 13:15:43 +0000
commit8fe59c584739d05c12b59737698241434a989974 (patch)
treef40f3534b561eeb5525cf9e44d214614d18ec514 /graphics/lensfun
parentea693bfbf2499a0cf29964f96ae65c798de5a742 (diff)
downloadports-8fe59c584739d05c12b59737698241434a989974.tar.gz
ports-8fe59c584739d05c12b59737698241434a989974.zip
lensfun: allocate buffers for AddMount()/AddCompat() large enough
...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: https://github.com/lensfun/lensfun/commit/de954c952929316ea2ad0f6f1e336d9d8164ace0 Not handed in for maintainer approval because obviously correct, maintainer will be notified though.
Notes
Notes: svn path=/head/; revision=525547
Diffstat (limited to 'graphics/lensfun')
-rw-r--r--graphics/lensfun/Makefile1
-rw-r--r--graphics/lensfun/files/patch-libs_lensfun_lens.cpp11
-rw-r--r--graphics/lensfun/files/patch-libs_lensfun_mount.cpp11
3 files changed, 23 insertions, 0 deletions
diff --git a/graphics/lensfun/Makefile b/graphics/lensfun/Makefile
index d7ef61ba8e3d..60d3c2780fc3 100644
--- a/graphics/lensfun/Makefile
+++ b/graphics/lensfun/Makefile
@@ -3,6 +3,7 @@
PORTNAME= lensfun
PORTVERSION= 0.3.95
+PORTREVISION= 1
CATEGORIES= graphics
MASTER_SITES= SF/${PORTNAME}/${PORTVERSION}
diff --git a/graphics/lensfun/files/patch-libs_lensfun_lens.cpp b/graphics/lensfun/files/patch-libs_lensfun_lens.cpp
new file mode 100644
index 000000000000..150135ffa841
--- /dev/null
+++ b/graphics/lensfun/files/patch-libs_lensfun_lens.cpp
@@ -0,0 +1,11 @@
+--- libs/lensfun/lens.cpp.orig 2018-06-29 10:29:17 UTC
++++ 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/graphics/lensfun/files/patch-libs_lensfun_mount.cpp b/graphics/lensfun/files/patch-libs_lensfun_mount.cpp
new file mode 100644
index 000000000000..2f1095e11c48
--- /dev/null
+++ b/graphics/lensfun/files/patch-libs_lensfun_mount.cpp
@@ -0,0 +1,11 @@
+--- 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);
+