projects
/
xonotic
/
netradiant.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7f8a2e
)
prevent string overflow in radiant md2 loader
author
Garux <garux@mail.ru>
Fri, 22 Feb 2019 20:31:56 +0000
(23:31 +0300)
committer
Thomas Debesse <dev@illwieckz.net>
Tue, 27 Apr 2021 01:45:03 +0000
(
03:45
+0200)
plugins/md3model/md2.cpp
patch
|
blob
|
history
diff --git
a/plugins/md3model/md2.cpp
b/plugins/md3model/md2.cpp
index bb481bed3817fc8726d95df14d957be7fc1f3eeb..a347c5f4909f2b7e20909cd56cd2a6bab781dc46 100644
(file)
--- 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();