diff --git a/devel/liblas/files/patch-CVE-2018-20540 b/devel/liblas/files/patch-CVE-2018-20540 new file mode 100644 index 000000000000..8cd6f66b5e11 --- /dev/null +++ b/devel/liblas/files/patch-CVE-2018-20540 @@ -0,0 +1,55 @@ +From 09d45518776489508f34098f1c159f58b856f459 Mon Sep 17 00:00:00 2001 +From: Mateusz Loskot +Date: Sun, 20 Jan 2019 02:28:29 +0100 +Subject: [PATCH] Ensure stream is deallocated in case of exception (#162) + +Fixes #158 +--- + include/liblas/liblas.hpp | 32 ++++++++++++++++++++++++-------- + 1 file changed, 24 insertions(+), 8 deletions(-) + +diff --git include/liblas/liblas.hpp include/liblas/liblas.hpp +index f5ad44e1..325de3ff 100644 +--- include/liblas/liblas.hpp ++++ include/liblas/liblas.hpp +@@ -119,16 +119,32 @@ inline std::istream* Open(std::string const& filename, std::ios::openmode mode) + { + #ifdef USE_BOOST_IO + namespace io = boost::iostreams; +- io::stream* ifs = new io::stream(); +- ifs->open(filename.c_str(), mode); +- if (ifs->is_open() == false) return NULL; +- return ifs; ++ io::stream* ifs = NULL; ++ try ++ { ++ ifs = new io::stream(); ++ ifs->open(filename.c_str(), mode); ++ if (ifs->is_open() == false) return NULL; ++ return ifs; ++ } ++ catch (...) ++ { ++ delete ifs; ++ } + #else +- std::ifstream* ifs = new std::ifstream(); +- ifs->open(filename.c_str(), mode); +- if (ifs->is_open() == false) return NULL; +- return ifs; ++ std::ifstream* ifs = NULL; ++ try ++ { ++ ifs = new std::ifstream(); ++ ifs->open(filename.c_str(), mode); ++ if (ifs->is_open() == false) return NULL; ++ } ++ catch (...) ++ { ++ delete ifs; ++ } + #endif ++ return NULL; + } + + /// Create file and open to write in binary mode. diff --git a/devel/liblas/files/patch-CVE-2018-20540-fixup b/devel/liblas/files/patch-CVE-2018-20540-fixup new file mode 100644 index 000000000000..00bf344a0a16 --- /dev/null +++ b/devel/liblas/files/patch-CVE-2018-20540-fixup @@ -0,0 +1,24 @@ +From 6a666b9101293b13fde4e4eb1d2c627f7613515e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Felipe=20M=2E=20L=C3=B3pez?= +Date: Fri, 19 Jul 2019 08:26:44 +0200 +Subject: [PATCH] Always return NULL when Open() is used (#168) + +Attempt to open LAS file using standard stream, without +Boost supports built in, always failed with +"Cannot open sample.las for read. Exiting..." +--- + include/liblas/liblas.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git include/liblas/liblas.hpp include/liblas/liblas.hpp +index 325de3ff..5c950ce0 100644 +--- include/liblas/liblas.hpp ++++ include/liblas/liblas.hpp +@@ -138,6 +138,7 @@ inline std::istream* Open(std::string const& filename, std::ios::openmode mode) + ifs = new std::ifstream(); + ifs->open(filename.c_str(), mode); + if (ifs->is_open() == false) return NULL; ++ return ifs; + } + catch (...) + { diff --git a/devel/liblas/files/patch-boost-1.73 b/devel/liblas/files/patch-boost-1.73 new file mode 100644 index 000000000000..606f3837d9c2 --- /dev/null +++ b/devel/liblas/files/patch-boost-1.73 @@ -0,0 +1,55 @@ +diff --git include/liblas/detail/binary.hpp include/liblas/detail/binary.hpp +index d3116a1..ab20e06 100644 +--- include/liblas/detail/binary.hpp ++++ include/liblas/detail/binary.hpp +@@ -17,6 +17,8 @@ + #ifndef LIBLAS_DETAIL_BINARY_HPP_INCLUDED + #define LIBLAS_DETAIL_BINARY_HPP_INCLUDED + ++#include ++ + #include + #include + #include +@@ -25,7 +27,6 @@ + + #include + #include +-#include + #include + + #if CHAR_BIT != 8 +@@ -43,7 +44,7 @@ namespace detail { namespace binary { + struct big_endian_tag {}; + struct little_endian_tag {}; + +-#ifdef BOOST_BIG_ENDIAN ++#ifdef LIBLAS_BIG_ENDIAN + typedef big_endian_tag native_endian_tag; + #else + typedef little_endian_tag native_endian_tag; +diff --git src/c_api.cpp src/c_api.cpp +index a70fe74..e8be785 100644 +--- src/c_api.cpp ++++ src/c_api.cpp +@@ -96,6 +96,7 @@ using namespace liblas; + #endif + + #include ++#include + + bool IsReprojectionTransform(liblas::TransformPtr const& p) + { +diff --git src/header.cpp src/header.cpp +index 9987ce1..a5c8f7d 100644 +--- src/header.cpp ++++ src/header.cpp +@@ -54,7 +54,7 @@ + // boost + #include + #include +- ++#include + //std + #include + #include diff --git a/devel/liblas/files/patch-fix-overload-call b/devel/liblas/files/patch-fix-overload-call new file mode 100644 index 000000000000..9c5b853347b2 --- /dev/null +++ b/devel/liblas/files/patch-fix-overload-call @@ -0,0 +1,15 @@ +--- src/gt_citation.cpp ++++ src/gt_citation.cpp +@@ -387,10 +387,10 @@ + osCitation += primemName; + bRewriteGeogCitation = TRUE; + +- double primemValue = poSRS->GetPrimeMeridian(NULL); ++ double primemValue = poSRS->GetPrimeMeridian(); + if(angUnitName && !EQUAL(angUnitName, "Degree")) + { +- double aUnit = poSRS->GetAngularUnits(NULL); ++ double aUnit = poSRS->GetAngularUnits(); + primemValue *= aUnit; + } + GTIFKeySet( psGTIF, GeogPrimeMeridianLongGeoKey, TYPE_DOUBLE, 1, diff --git a/devel/liblas/files/patch-gdal-2.5.0 b/devel/liblas/files/patch-gdal-2.5.0 new file mode 100644 index 000000000000..59a7939c1660 --- /dev/null +++ b/devel/liblas/files/patch-gdal-2.5.0 @@ -0,0 +1,34 @@ +From 3a572ff7e684668da62c794b37ccccbc169723de Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner +Date: Wed, 26 Feb 2020 17:45:30 +0100 +Subject: [PATCH] Fix build against >=GDAL-2.5.0 + +Signed-off-by: Andreas Sturmlechner +--- + src/gt_wkt_srs.cpp | 3 --- + 1 file changed, 3 deletions(-) + +diff --git src/gt_wkt_srs.cpp src/gt_wkt_srs.cpp +index 9871aa0..099972d 100755 +--- src/gt_wkt_srs.cpp ++++ src/gt_wkt_srs.cpp +@@ -493,7 +493,6 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn ) + { + char *pszWKT; + oSRS.morphFromESRI(); +- oSRS.FixupOrdering(); + if( oSRS.exportToWkt( &pszWKT ) == OGRERR_NONE ) + return pszWKT; + } +@@ -1094,8 +1093,6 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn ) + /* ==================================================================== */ + char *pszWKT; + +- oSRS.FixupOrdering(); +- + if( oSRS.exportToWkt( &pszWKT ) == OGRERR_NONE ) + return pszWKT; + else +-- +2.25.1 +