فهرست منبع

Importer: fix overflowImporter: fix overflow.

Kim Kulling 9 سال پیش
والد
کامیت
8736907009
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      code/Importer.cpp

+ 2 - 1
code/Importer.cpp

@@ -503,7 +503,8 @@ const aiScene* Importer::ReadFileFromMemory( const void* pBuffer,
     SetIOHandler(new MemoryIOSystem((const uint8_t*)pBuffer,pLength));
     SetIOHandler(new MemoryIOSystem((const uint8_t*)pBuffer,pLength));
 
 
     // read the file and recover the previous IOSystem
     // read the file and recover the previous IOSystem
-    char fbuff[128];
+    static const size_t BufferSize(Importer::MaxLenHint + 28);
+    char fbuff[ BufferSize ];
     sprintf(fbuff,"%s.%s",AI_MEMORYIO_MAGIC_FILENAME,pHint);
     sprintf(fbuff,"%s.%s",AI_MEMORYIO_MAGIC_FILENAME,pHint);
 
 
     ReadFile(fbuff,pFlags);
     ReadFile(fbuff,pFlags);