[iortcw] 114/152: All: Fix string buffer overflow
Simon McVittie
smcv at debian.org
Fri Sep 8 10:40:20 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.5a
in repository iortcw.
commit dad016fc9e3da1a280023c396e292574f369806f
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Tue Sep 13 17:39:40 2016 -0400
All: Fix string buffer overflow
---
MP/code/botlib/l_precomp.c | 2 +-
SP/code/botlib/l_precomp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/MP/code/botlib/l_precomp.c b/MP/code/botlib/l_precomp.c
index 8f51340..eac3221 100644
--- a/MP/code/botlib/l_precomp.c
+++ b/MP/code/botlib/l_precomp.c
@@ -1295,7 +1295,7 @@ define_t *PC_DefineFromString( char *string ) {
script = LoadScriptMemory( string, strlen( string ), "*extern" );
//create a new source
memset( &src, 0, sizeof( source_t ) );
- strncpy( src.filename, "*extern", _MAX_PATH );
+ strncpy( src.filename, "*extern", sizeof( src.filename ) - 1 );
src.scriptstack = script;
#if DEFINEHASHING
src.definehash = GetClearedMemory( DEFINEHASHSIZE * sizeof( define_t * ) );
diff --git a/SP/code/botlib/l_precomp.c b/SP/code/botlib/l_precomp.c
index 5fb57f0..c11d12a 100644
--- a/SP/code/botlib/l_precomp.c
+++ b/SP/code/botlib/l_precomp.c
@@ -1291,7 +1291,7 @@ define_t *PC_DefineFromString( char *string ) {
script = LoadScriptMemory( string, strlen( string ), "*extern" );
//create a new source
memset( &src, 0, sizeof( source_t ) );
- strncpy( src.filename, "*extern", _MAX_PATH );
+ strncpy( src.filename, "*extern", sizeof( src.filename ) - 1 );
src.scriptstack = script;
#if DEFINEHASHING
src.definehash = GetClearedMemory( DEFINEHASHSIZE * sizeof( define_t * ) );
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list