assimp/CVE-2025-3015.patch
changtao 3e65fd2ec9 fix CVE-2025-3015 CVE-2025-3016
(cherry picked from commit 3eac85125b760dd4c29f3f42da5882919720f99e)
2025-04-03 09:06:57 +08:00

27 lines
1.1 KiB
Diff

From 7c705fde418d68cca4e8eff56be01b2617b0d6fe Mon Sep 17 00:00:00 2001
From: Kim Kulling <kimkulling@users.noreply.github.com>
Date: Wed, 12 Mar 2025 21:12:02 +0100
Subject: [PATCH] ASE: Fix possible out of bound access. (#6045)
---
code/AssetLib/ASE/ASELoader.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/code/AssetLib/ASE/ASELoader.cpp b/code/AssetLib/ASE/ASELoader.cpp
index 4617c9e..a622bb0 100644
--- a/code/AssetLib/ASE/ASELoader.cpp
+++ b/code/AssetLib/ASE/ASELoader.cpp
@@ -730,6 +730,10 @@ void ASEImporter::BuildUniqueRepresentation(ASE::Mesh &mesh) {
unsigned int iCurrent = 0, fi = 0;
for (std::vector<ASE::Face>::iterator i = mesh.mFaces.begin(); i != mesh.mFaces.end(); ++i, ++fi) {
for (unsigned int n = 0; n < 3; ++n, ++iCurrent) {
+ const uint32_t curIndex = (*i).mIndices[n];
+ if (curIndex >= mesh.mPositions.size()) {
+ throw DeadlyImportError("ASE: Invalid vertex index in face ", fi, ".");
+ }
mPositions[iCurrent] = mesh.mPositions[(*i).mIndices[n]];
// add texture coordinates
--
2.46.0