forked from github/server
CID 22561: Copy into fixed size buffer (STRING_OVERFLOW)
This commit is contained in:
parent
be0563c1f0
commit
68f8f0830e
|
@ -1773,7 +1773,10 @@ const char *trailinto(const region * r, const struct locale *lang)
|
|||
const char *s;
|
||||
if (r) {
|
||||
const char *tname = terrain_name(r);
|
||||
strcat(strcpy(ref, tname), "_trail");
|
||||
size_t sz;
|
||||
|
||||
sz = strlcpy(ref, tname, sizeof(ref));
|
||||
sz += strlcat(ref+sz, "_trail", sizeof(ref)-sz);
|
||||
s = LOC(lang, ref);
|
||||
if (s && *s) {
|
||||
if (strstr(s, "%s"))
|
||||
|
|
Loading…
Reference in New Issue