From dab37177d2a3e488528cd801bbb80ddbb431b762 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Wed, 8 Jul 2015 06:53:29 +0200
Subject: [PATCH] Using secure GeoLib::Point constructor.

---
 .../Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp   | 2 +-
 GeoLib/MinimalBoundingSphere.h                                  | 2 +-
 MeshLib/ElementCoordinatesMappingLocal.cpp                      | 2 +-
 MeshLib/MeshSurfaceExtraction.cpp                               | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp
index cceb811ff0c..6743315623e 100644
--- a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp
+++ b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp
@@ -220,7 +220,7 @@ int main (int argc, char* argv[])
 	std::vector<GeoLib::Point> pnts_with_id;
 	const size_t n_merged_pnts(merged_pnts->size());
 	for(std::size_t k(0); k<n_merged_pnts; ++k) {
-		pnts_with_id.emplace_back((*merged_pnts)[k]->getCoords(), k);
+		pnts_with_id.emplace_back(*((*merged_pnts)[k]), k);
 	}
 
 	std::sort(pnts_with_id.begin(), pnts_with_id.end(),
diff --git a/GeoLib/MinimalBoundingSphere.h b/GeoLib/MinimalBoundingSphere.h
index b27b6a7422b..2427be5c348 100644
--- a/GeoLib/MinimalBoundingSphere.h
+++ b/GeoLib/MinimalBoundingSphere.h
@@ -46,7 +46,7 @@ public:
     MinimalBoundingSphere(std::vector<MathLib::Point3d*> const& points);
 
     /// Returns the center point of the sphere
-    MathLib::Point3d getCenter() const { return MathLib::Point3d(_center.getCoords()); }
+    MathLib::Point3d getCenter() const { return MathLib::Point3d(_center); }
 
     /// Returns the radius of the sphere
     double getRadius() const {return _radius; }
diff --git a/MeshLib/ElementCoordinatesMappingLocal.cpp b/MeshLib/ElementCoordinatesMappingLocal.cpp
index 1350dec3fb4..044d7e9ac22 100644
--- a/MeshLib/ElementCoordinatesMappingLocal.cpp
+++ b/MeshLib/ElementCoordinatesMappingLocal.cpp
@@ -74,7 +74,7 @@ ElementCoordinatesMappingLocal::ElementCoordinatesMappingLocal(
     assert(e.getDimension() <= global_coords.getDimension());
     _points.reserve(e.getNNodes());
     for(unsigned i = 0; i < e.getNNodes(); i++)
-        _points.emplace_back(e.getNode(i)->getCoords());
+        _points.emplace_back(*(e.getNode(i)));
 
     auto const element_dimension = e.getDimension();
     auto const global_dimension = global_coords.getDimension();
diff --git a/MeshLib/MeshSurfaceExtraction.cpp b/MeshLib/MeshSurfaceExtraction.cpp
index afd2c4e62b1..27a66042bc9 100644
--- a/MeshLib/MeshSurfaceExtraction.cpp
+++ b/MeshLib/MeshSurfaceExtraction.cpp
@@ -248,7 +248,7 @@ std::vector<GeoLib::Point*> MeshSurfaceExtraction::getSurfaceNodes(const MeshLib
 	std::vector<GeoLib::Point*> surface_pnts(nNodes);
 	for (std::size_t i=0; i<nNodes; ++i)
 	{
-		surface_pnts[i] = new GeoLib::Point(sfc_nodes[i]->getCoords(), sfc_nodes[i]->getID());
+		surface_pnts[i] = new GeoLib::Point(*(sfc_nodes[i]), sfc_nodes[i]->getID());
 		delete sfc_nodes[i];
 	}
 	return surface_pnts;
-- 
GitLab