assimp/CVE-2025-3160.patch
changtao 9e6f57bc34 fix CVE-2025-3160
(cherry picked from commit 7e47ef0650b2962d2a9a07cac58d94b5a1911a7d)
2025-04-07 10:38:58 +08:00

30 lines
1.2 KiB
Diff

From a0993658f40d8e13ff5823990c30b43c82a5daf0 Mon Sep 17 00:00:00 2001
From: Kim Kulling <kimkulling@users.noreply.github.com>
Date: Thu, 13 Mar 2025 10:24:20 +0100
Subject: [PATCH] Bugfix: Fix possible nullptr dereferencing
- closes https://github.com/assimp/assimp/issues/6025
---
code/Common/SceneCombiner.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/code/Common/SceneCombiner.cpp b/code/Common/SceneCombiner.cpp
index 0188f5d..4a9c6eb 100644
--- a/code/Common/SceneCombiner.cpp
+++ b/code/Common/SceneCombiner.cpp
@@ -95,6 +95,11 @@ inline void PrefixString(aiString &string, const char *prefix, unsigned int len)
// ------------------------------------------------------------------------------------------------
// Add node identifiers to a hashing set
void SceneCombiner::AddNodeHashes(aiNode *node, std::set<unsigned int> &hashes) {
+ if (node == nullptr) {
+ ASSIMP_LOG_VERBOSE_DEBUG("Pointer to aiNode is nullptr.");
+ return;
+ }
+
// Add node name to hashing set if it is non-empty - empty nodes are allowed
// and they can't have any anims assigned so its absolutely safe to duplicate them.
if (node->mName.length) {
--
2.41.0