UnrealLoader: replace sprintf by snprintf.
authorKim Kulling <kim.kulling@googlemail.com>
Mon, 4 Jan 2016 19:22:46 +0000 (20:22 +0100)
committerKim Kulling <kim.kulling@googlemail.com>
Mon, 4 Jan 2016 19:22:46 +0000 (20:22 +0100)
code/UnrealLoader.cpp

index eeb2804..6bb0409 100644 (file)
@@ -377,7 +377,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile,
         aiColor3D color(1.f,1.f,1.f);
 
         aiString s;
-        ::sprintf(s.data,"mat%u_tx%u_",i,materials[i].tex);
+        ::sprintf( s.data, MAXLEN, "mat%u_tx%u_",i,materials[i].tex );
 
         // set the two-sided flag
         if (materials[i].type == Unreal::MF_NORMAL_TS) {
@@ -397,7 +397,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile,
 
         // a special name for the weapon attachment point
         if (materials[i].type == Unreal::MF_WEAPON_PLACEHOLDER) {
-            s.length = ::sprintf(s.data,"$WeaponTag$");
+            s.length = ::snprintf( s.data, MAXLEN, "$WeaponTag$" );
             color = aiColor3D(0.f,0.f,0.f);
         }