Skip to content

Commit

Permalink
Fixed a possibly non-null-terminated string
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabr0sa committed Jun 3, 2021
1 parent 7971de8 commit 7c5d790
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions D3D11Engine/GMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ XRESULT GMesh::LoadCached( const std::string& file ) {
// Read texture name
unsigned char numTxNameChars;
fread( &numTxNameChars, sizeof( numTxNameChars ), 1, f );
char tx[255];
memset( tx, 0, 255 );
char tx[256] = { '\0' };
fread( tx, numTxNameChars, 1, f );

// Read num submeshes
Expand Down

0 comments on commit 7c5d790

Please sign in to comment.