From 3ee0dee12a06c26f0984028a1a56a3f3b240447f Mon Sep 17 00:00:00 2001 From: pasky Date: Mon, 22 Nov 2004 21:41:25 +0000 Subject: (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). --- station_gui.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'station_gui.c') diff --git a/station_gui.c b/station_gui.c index c0fca5411..9cbf0a66d 100644 --- a/station_gui.c +++ b/station_gui.c @@ -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]); -- cgit v1.2.3-70-g09d2