Date: Sat, 8 Feb 2020 13:15:44 +0000 (UTC) From: Matthias Andree <mandree@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r525547 - in head/graphics/lensfun: . files Message-ID: <202002081315.018DFi7l060330@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mandree Date: Sat Feb 8 13:15:43 2020 New Revision: 525547 URL: https://svnweb.freebsd.org/changeset/ports/525547 Log: 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. Added: head/graphics/lensfun/files/patch-libs_lensfun_lens.cpp (contents, props changed) head/graphics/lensfun/files/patch-libs_lensfun_mount.cpp (contents, props changed) Modified: head/graphics/lensfun/Makefile Modified: head/graphics/lensfun/Makefile ============================================================================== --- head/graphics/lensfun/Makefile Sat Feb 8 12:50:18 2020 (r525546) +++ head/graphics/lensfun/Makefile Sat Feb 8 13:15:43 2020 (r525547) @@ -3,6 +3,7 @@ PORTNAME= lensfun PORTVERSION= 0.3.95 +PORTREVISION= 1 CATEGORIES= graphics MASTER_SITES= SF/${PORTNAME}/${PORTVERSION} Added: head/graphics/lensfun/files/patch-libs_lensfun_lens.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/lensfun/files/patch-libs_lensfun_lens.cpp Sat Feb 8 13:15:43 2020 (r525547) @@ -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); + Added: head/graphics/lensfun/files/patch-libs_lensfun_mount.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/lensfun/files/patch-libs_lensfun_mount.cpp Sat Feb 8 13:15:43 2020 (r525547) @@ -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); +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002081315.018DFi7l060330>