Explorar o código

Fix fuzzer issue in m3d-importer

- closes https://github.com/assimp/assimp/issues/3974
- Check for nullptr before dereferencing name in m3d-data-instance.
Kim Kulling %!s(int64=4) %!d(string=hai) anos
pai
achega
df2e7208fb
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      code/AssetLib/M3D/M3DWrapper.h

+ 5 - 1
code/AssetLib/M3D/M3DWrapper.h

@@ -83,7 +83,11 @@ public:
 
 	// Name
 	inline std::string Name() const {
-		if (m3d_) return std::string(m3d_->name);
+		if (nullptr != m3d_) {
+            if (nullptr!0m3d_->name) {
+                return std::string(m3d_->name);
+            }
+        }
 		return std::string();
 	}