summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-24 09:30:30 +0000
committerrubidium <rubidium@openttd.org>2013-11-24 09:30:30 +0000
commita8e8f606d89055397a37dbe5c7a1b3d46d08cf8a (patch)
tree50e2c3d2c4309fb526be3a3ff3437a9ac8aab708 /src
parent5e2d22da799799ba787fbf8d6a34a6f88f04f190 (diff)
downloadopenttd-a8e8f606d89055397a37dbe5c7a1b3d46d08cf8a.tar.xz
(svn r26080) -Fix: possible out of bounds array access
Diffstat (limited to 'src')
-rw-r--r--src/industry_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index b77891368..6f13dfeaf 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -1961,7 +1961,7 @@ struct CargoesRow {
assert(cargo_fld->type == CFT_CARGO && label_fld->type == CFT_EMPTY);
for (uint i = 0; i < cargo_fld->u.cargo.num_cargoes; i++) {
int col = cargo_fld->ConnectCargo(cargo_fld->u.cargo.vertical_cargoes[i], !accepting);
- cargoes[col] = cargo_fld->u.cargo.vertical_cargoes[i];
+ if (col >= 0) cargoes[col] = cargo_fld->u.cargo.vertical_cargoes[i];
}
label_fld->MakeCargoLabel(cargoes, lengthof(cargoes), accepting);
}