summaryrefslogtreecommitdiff
path: root/graphics/libraw/files/patch-internal_dcraw__common.cpp
diff options
context:
space:
mode:
authorJason E. Hale <jhale@FreeBSD.org>2017-10-08 13:11:17 +0000
committerJason E. Hale <jhale@FreeBSD.org>2017-10-08 13:11:17 +0000
commita16d9e9f97932862f4433c03ee35493ec26fd29d (patch)
tree995762d0b543cfb2219477675f661f3bb7aef303 /graphics/libraw/files/patch-internal_dcraw__common.cpp
parentMFH: r451107 r451127 r451191 r451275 (diff)
MFH: r4509362017Q3
Update to 0.18.5 This addresses CVE-2017-14265, CVE-2017-14348, and CVE-2017-14608 Use FreeBSD libc strnlen and strcasestr functions instead of bundled [1] PR: 219029 [1] Submitted by: mi [1] Security: 4cd857d9-26d2-4417-b765-69701938f9e0 Security: d9f96741-47bd-4426-9aba-8736c0971b24 Security: 02bee9ae-c5d1-409b-8a79-983a88861509 Approved by: ports-secteam (swills)
Diffstat (limited to 'graphics/libraw/files/patch-internal_dcraw__common.cpp')
-rw-r--r--graphics/libraw/files/patch-internal_dcraw__common.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/graphics/libraw/files/patch-internal_dcraw__common.cpp b/graphics/libraw/files/patch-internal_dcraw__common.cpp
new file mode 100644
index 000000000000..e83775e970e9
--- /dev/null
+++ b/graphics/libraw/files/patch-internal_dcraw__common.cpp
@@ -0,0 +1,32 @@
+Use strnlen(3) and strcasestr(3) from FreeBSD's libc instead of the bundled
+versions. Patch has been applied upstream in master branch:
+https://github.com/LibRaw/LibRaw/commit/b1a2984
+
+--- internal/dcraw_common.cpp.orig 2017-09-22 06:35:16 UTC
++++ internal/dcraw_common.cpp
+@@ -51,6 +51,8 @@ int CLASS fcol (int row, int col)
+ if (filters == 9) return xtrans[(row+6) % 6][(col+6) % 6];
+ return FC(row,col);
+ }
++
++#if !defined(__FreeBSD__)
+ static size_t local_strnlen(const char *s, size_t n)
+ {
+ const char *p = (const char *)memchr(s, 0, n);
+@@ -58,6 +60,7 @@ static size_t local_strnlen(const char *
+ }
+ /* add OS X version check here ?? */
+ #define strnlen(a,b) local_strnlen(a,b)
++#endif
+
+ #ifdef LIBRAW_LIBRARY_BUILD
+ static int stread(char *buf, size_t len, LibRaw_abstract_datastream *fp)
+@@ -69,7 +72,7 @@ static int stread(char *buf, size_t len,
+ #define stmread(buf,maxlen,fp) stread(buf,MIN(maxlen,sizeof(buf)),fp)
+ #endif
+
+-#ifndef __GLIBC__
++#if !defined(__GLIBC__) && !defined(__FreeBSD__)
+ char *my_memmem (char *haystack, size_t haystacklen,
+ char *needle, size_t needlelen)
+ {