| タイトル | Open Asset Import Library Assimp 5.4.3 Use After Free |
|---|
| 説明 | The program experiences a heap-use-after-free error when accessing a `std::vector` in the `Assimp::BVHLoader::ReadNodeChannels` function in `assimp/code/AssetLib/BVH/BVHLoader.cpp:303` . The error occurs after the memory for an object (specifically the `pNode` or its member `mChannels`) has been freed, but the program attempts to push a new element into the vector, causing undefined behavior and a crash.
```C++
void BVHLoader::ReadNodeChannels(BVHLoader::Node &pNode) {
// number of channels. Use the float reader because we're lazy
float numChannelsFloat = GetNextTokenAsFloat();
unsigned int numChannels = (unsigned int)numChannelsFloat;
for (unsigned int a = 0; a < numChannels; a++) {
std::string channelToken = GetNextToken();
...
else if (channelToken == "Zrotation")
pNode.mChannels.push_back(Channel_RotationZ);
else
ThrowException("Invalid channel specifier \"", channelToken, "\".");
}
}
```
This function attempts to push new values into the mChannels vector of pNode. The error occurs if pNode or its member mChannels has already been freed earlier in the program.
The following function appears to allocate memory for child nodes (`Assimp::BVHLoader::ReadNode()` in `assimp/code/AssetLib/BVH/BVHLoader.cpp`):
```C++
aiNode *child = ReadEndSite(nodeName);
child->mParent = node;
childNodes.push_back(child);
```
If a node or any of its components are freed prematurely (perhaps when deleting `node->mChildren`), any subsequent access to them could cause the heap-use-after-free error observed.
|
|---|
| ソース | ⚠️ https://github.com/assimp/assimp/issues/6219 |
|---|
| ユーザー | Rulkallos (UID 86201) |
|---|
| 送信 | 2025年06月06日 08:23 (1 年 ago) |
|---|
| モデレーション | 2025年06月15日 12:18 (9 days later) |
|---|
| ステータス | 承諾済み |
|---|
| VulDBエントリ | 312588 [Open Asset Import Library Assimp 迄 5.4.3 BVHLoader.cpp ReadNodeChannels pNode メモリ破損] |
|---|
| ポイント | 20 |
|---|