Browse Source

Adding sdformat library patch for addressing security review issues.

The security review issues addressed were found by MicroFocus Fortify

Signed-off-by: lumberyard-employee-dm <[email protected]>
lumberyard-employee-dm 2 years ago
parent
commit
fef8b56a24
2 changed files with 40 additions and 0 deletions
  1. 1 0
      package-system/sdformat/build_config.json
  2. 39 0
      package-system/sdformat/fortify.patch

+ 1 - 0
package-system/sdformat/build_config.json

@@ -6,6 +6,7 @@
    "package_url":"https://github.com/gazebosim/sdformat.git",
    "package_url":"https://github.com/gazebosim/sdformat.git",
    "package_license":"MIT",
    "package_license":"MIT",
    "package_license_file":"LICENSE",
    "package_license_file":"LICENSE",
+   "patch_file": "fortify.patch",
    "cmake_find_target":"Findsdformat.cmake",
    "cmake_find_target":"Findsdformat.cmake",
    "Platforms":{
    "Platforms":{
       "Linux":{
       "Linux":{

+ 39 - 0
package-system/sdformat/fortify.patch

@@ -0,0 +1,39 @@
+diff --git a/src/Camera.cc b/src/Camera.cc
+index c41850a0..4f9a199b 100644
+--- a/src/Camera.cc
++++ b/src/Camera.cc
+@@ -1144,7 +1144,7 @@ void Camera::SetLensIntrinsicsSkew(double _s)
+ /////////////////////////////////////////////////
+ std::string Camera::ConvertPixelFormat(PixelFormatType _type)
+ {
+-  unsigned int index = static_cast<int>(_type);
++  unsigned int index = static_cast<unsigned int>(_type);
+   if (index < kPixelFormatNames.size())
+     return kPixelFormatNames[static_cast<int>(_type)];
+ 
+diff --git a/src/ParticleEmitter.cc b/src/ParticleEmitter.cc
+index 347df7f4..e10624c7 100644
+--- a/src/ParticleEmitter.cc
++++ b/src/ParticleEmitter.cc
+@@ -265,7 +265,7 @@ bool ParticleEmitter::SetType(const std::string &_typeStr)
+ /////////////////////////////////////////////////
+ std::string ParticleEmitter::TypeStr() const
+ {
+-  size_t index = static_cast<int>(this->dataPtr->type);
++  size_t index = static_cast<size_t>(this->dataPtr->type);
+   if (index < emitterTypeStrs.size())
+     return emitterTypeStrs[index];
+   return "point";
+diff --git a/src/Sensor.cc b/src/Sensor.cc
+index 6c6dde9d..324a3422 100644
+--- a/src/Sensor.cc
++++ b/src/Sensor.cc
+@@ -644,7 +644,7 @@ void Sensor::SetUpdateRate(double _hz)
+ /////////////////////////////////////////////////
+ std::string Sensor::TypeStr() const
+ {
+-  size_t index = static_cast<int>(this->dataPtr->type);
++  size_t index = static_cast<size_t>(this->dataPtr->type);
+   if (index > 0 && index < sensorTypeStrs.size())
+     return sensorTypeStrs[index];
+   return "none";