From: Garux Date: Fri, 22 Feb 2019 20:31:56 +0000 (+0300) Subject: prevent string overflow in radiant md2 loader X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1032b4ef92400a8f99455188cab36b09f30fe6a5;p=xonotic%2Fnetradiant.git prevent string overflow in radiant md2 loader --- diff --git a/plugins/md3model/md2.cpp b/plugins/md3model/md2.cpp index bb481bed..a347c5f4 100644 --- a/plugins/md3model/md2.cpp +++ b/plugins/md3model/md2.cpp @@ -256,7 +256,8 @@ void MD2Surface_read( Model& model, const byte* buffer, ArchiveFile& file ){ } else { - strcpy( skinname, skinnameRelative ); + strncpy( skinname, skinnameRelative, MD2_MAX_SKINNAME - 1 ); + skinname[MD2_MAX_SKINNAME - 1] = '\0'; } surface.setShader( skinname ); surface.updateAABB();