Fix buffer overflow. Bugreport from Nick Voronin

This commit is contained in:
Stas Degteff 2010-03-28 17:20:21 +00:00
parent 9f7400b7aa
commit 19fdb52aab

View File

@ -346,7 +346,7 @@ static bool AreaListCmp2(const Area* a, const Area* b) {
void AreaList::Sort(const char* specs, int first, int last) { void AreaList::Sort(const char* specs, int first, int last) {
if(specs) if(specs)
strcpy(sortspec, specs); strxcpy(sortspec, specs, sizeof(sortspec));
else else
strcpy(sortspec, CFG->arealistsort); strcpy(sortspec, CFG->arealistsort);
if(last == -1) if(last == -1)