diff options
| author | jj | 2012-09-29 01:38:32 +0200 |
|---|---|---|
| committer | jj | 2012-09-29 01:38:32 +0200 |
| commit | 12f5e6028ce91e67143c7dad317ffe1430603193 (patch) | |
| tree | f28817dbf22c0ffd7de235239b1308b5ee73bbd6 /plugins/manipulator.cpp | |
| parent | 44a74ddc38abf86d093db2e7ff2aa3af24bf8173 (diff) | |
| download | dfhack-12f5e6028ce91e67143c7dad317ffe1430603193.tar.gz dfhack-12f5e6028ce91e67143c7dad317ffe1430603193.tar.bz2 dfhack-12f5e6028ce91e67143c7dad317ffe1430603193.tar.xz | |
manipulator: avoid NULL deref with unassigned job in unit list
Diffstat (limited to 'plugins/manipulator.cpp')
| -rw-r--r-- | plugins/manipulator.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/manipulator.cpp b/plugins/manipulator.cpp index 953cf2ba..feceb08e 100644 --- a/plugins/manipulator.cpp +++ b/plugins/manipulator.cpp @@ -383,8 +383,12 @@ viewscreen_unitlaborsst::viewscreen_unitlaborsst(vector<df::unit*> &src, int cur for (size_t i = 0; i < src.size(); i++) { - UnitInfo *cur = new UnitInfo; df::unit *unit = src[i]; + if (!unit) + continue; + + UnitInfo *cur = new UnitInfo; + cur->unit = unit; cur->allowEdit = true; cur->active_index = active_idx[unit]; |
