mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-30 07:41:16 +00:00
Merge pull request #221 from tkoeppe/strncpy
[code/botlib/l_precomp.c] Fix string buffer overflow
This commit is contained in:
commit
4c169ab574
1 changed files with 1 additions and 1 deletions
|
@ -1323,7 +1323,7 @@ define_t *PC_DefineFromString(char *string)
|
||||||
script = LoadScriptMemory(string, strlen(string), "*extern");
|
script = LoadScriptMemory(string, strlen(string), "*extern");
|
||||||
//create a new source
|
//create a new source
|
||||||
Com_Memset(&src, 0, sizeof(source_t));
|
Com_Memset(&src, 0, sizeof(source_t));
|
||||||
strncpy(src.filename, "*extern", MAX_PATH);
|
strncpy(src.filename, "*extern", sizeof(src.filename) - 1);
|
||||||
src.scriptstack = script;
|
src.scriptstack = script;
|
||||||
#if DEFINEHASHING
|
#if DEFINEHASHING
|
||||||
src.definehash = GetClearedMemory(DEFINEHASHSIZE * sizeof(define_t *));
|
src.definehash = GetClearedMemory(DEFINEHASHSIZE * sizeof(define_t *));
|
||||||
|
|
Loading…
Reference in a new issue