Skip to content

Commit

Permalink
Fix a bug in the assbin loader that reads uninitialized memory (assim…
Browse files Browse the repository at this point in the history
…p#5801)

* Fix a bug in the assbin loader that reads uninitialized memory

* Address review comment

---------

Co-authored-by: Kim Kulling <[email protected]>
  • Loading branch information
qingyouzhao and kimkulling authored Oct 18, 2024
1 parent 4b9ac76 commit a383cb1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/AssetLib/Assbin/AssbinLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ bool AssbinImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, boo
}

char s[32];
in->Read(s, sizeof(char), 32);
const size_t read = in->Read(s, sizeof(char), 32);

pIOHandler->Close(in);

if (read < 19) {
return false;
}

return strncmp(s, "ASSIMP.binary-dump.", 19) == 0;
}
Expand Down

0 comments on commit a383cb1

Please sign in to comment.