From f28a96121df2bf04e45f23b6b0f439edcc8848c6 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 2 Oct 2025 16:31:00 +0200 Subject: [PATCH] Change strcpy to strncpy for format hint safety (#6365) --- code/AssetLib/M3D/M3DImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/M3D/M3DImporter.cpp b/code/AssetLib/M3D/M3DImporter.cpp index 18f006a42..2a00caf04 100644 --- a/code/AssetLib/M3D/M3DImporter.cpp +++ b/code/AssetLib/M3D/M3DImporter.cpp @@ -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) {