(svn r767) Introduce USERSTRING_LEN (128) and try to make sure we don't overflow it anywhere (as long as we keep USERSTRING_LEN above 7 or so).

This commit is contained in:
pasky
2004-11-22 21:41:25 +00:00
parent d4b723a7c9
commit 3ee0dee12a
4 changed files with 7 additions and 3 deletions

View File

@@ -375,6 +375,8 @@ static void DrawStationViewWindow(Window *w)
b += 3;
for(i=0; i!=NUM_CARGO; i++) {
if (b + 5 > USERSTRING_LEN - 1)
break;
if (st->goods[i].waiting_acceptance & 0x8000) {
b[0] = 0x81;
WRITE_LE_UINT16(b+1, _cargoc.names_s[i]);