summaryrefslogtreecommitdiff
path: root/station_gui.c
diff options
context:
space:
mode:
authorpasky <pasky@openttd.org>2004-11-22 21:41:25 +0000
committerpasky <pasky@openttd.org>2004-11-22 21:41:25 +0000
commit3ee0dee12a06c26f0984028a1a56a3f3b240447f (patch)
tree4db8a64449865edaa93d47db6cc195f0d1893632 /station_gui.c
parentd4b723a7c9f653f134b33f1d7a130c6b996c1f75 (diff)
downloadopenttd-3ee0dee12a06c26f0984028a1a56a3f3b240447f.tar.xz
(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).
Diffstat (limited to 'station_gui.c')
-rw-r--r--station_gui.c2
1 files changed, 2 insertions, 0 deletions
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]);