Fix strncpy usage in botlib
All usage of strncpy in botlib should now either set string terminator or use Q_strncpyz.
This commit is contained in:
1 parent
8956ab41dd
commit
c12b81a273
8 files changed
+13
-14
No files matched your search
@@ -221,7 +221,7 @@ int ReadString(source_t *source, fielddef_t *fd, void *p)
|
||||
//remove the double quotes
|
||||
StripDoubleQuotes(token.string);
|
||||
//copy the string
|
||||
strncpy((char *) p, token.string, MAX_STRINGFIELD);
|
||||
strncpy((char *) p, token.string, MAX_STRINGFIELD-1);
|
||||
//make sure the string is closed with a zero
|
||||
((char *)p)[MAX_STRINGFIELD-1] = '\0';
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user