From df2e7208fbca1b609f20e994d5829a419d17a924 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 26 Jul 2021 11:56:26 +0200 Subject: [PATCH] Fix fuzzer issue in m3d-importer - closes https://github.com/assimp/assimp/issues/3974 - Check for nullptr before dereferencing name in m3d-data-instance. --- code/AssetLib/M3D/M3DWrapper.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/M3D/M3DWrapper.h b/code/AssetLib/M3D/M3DWrapper.h index 54d7a2eec..d5fc9eaa5 100644 --- a/code/AssetLib/M3D/M3DWrapper.h +++ b/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(); }