Change strcpy to strncpy for format hint safety (#6365)

This commit is contained in:
Kim Kulling
2025-10-02 16:31:00 +02:00
committed by GitHub
parent 6401aa9744
commit f28a96121d

View File

@@ -332,7 +332,7 @@ void M3DImporter::importTextures(const M3DWrapper &m3d) {
/* if we have the texture loaded, set format hint and pcData too */
tx->mWidth = t->w;
tx->mHeight = t->h;
strcpy(tx->achFormatHint, formatHint[t->f - 1]);
strncpy(tx->achFormatHint, formatHint[t->f - 1], 8);
tx->pcData = new aiTexel[tx->mWidth * tx->mHeight];
for (j = k = 0; j < tx->mWidth * tx->mHeight; j++) {
switch (t->f) {