forked from github/server
CID 22558: Copy into fixed size buffer (STRING_OVERFLOW)
bsdstring buffer size check
This commit is contained in:
parent
1fb04179dc
commit
5d273e475e
|
@ -307,7 +307,7 @@ const char *dbrace(const struct race *rc)
|
||||||
char *zPtr = zText;
|
char *zPtr = zText;
|
||||||
|
|
||||||
/* the english names are all in ASCII, so we don't need to worry about UTF8 */
|
/* the english names are all in ASCII, so we don't need to worry about UTF8 */
|
||||||
strcpy(zText, (const char *)LOC(get_locale("en"), rc_name_s(rc, NAME_SINGULAR)));
|
strlcpy(zText, (const char *)LOC(get_locale("en"), rc_name_s(rc, NAME_SINGULAR)), sizeof(zText));
|
||||||
while (*zPtr) {
|
while (*zPtr) {
|
||||||
*zPtr = (char)(toupper(*zPtr));
|
*zPtr = (char)(toupper(*zPtr));
|
||||||
++zPtr;
|
++zPtr;
|
||||||
|
|
Loading…
Reference in New Issue