From 7c8be3b262f54dfd65e47ceb9a16d778e72f32f9 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Wed, 6 Jun 2012 18:34:15 +0000 Subject: Fix a potential invalid memory access issue --- Stars45/CmdForceDlg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Stars45/CmdForceDlg.cpp') diff --git a/Stars45/CmdForceDlg.cpp b/Stars45/CmdForceDlg.cpp index 0c73d41..8f3bca4 100644 --- a/Stars45/CmdForceDlg.cpp +++ b/Stars45/CmdForceDlg.cpp @@ -294,7 +294,10 @@ CmdForceDlg::AddCombatGroup(CombatGroup* grp, bool last_child) } } - pipe_stack[stacklen-1] = 0; + if (stacklen > 1) + pipe_stack[stacklen-1] = 0; + else + pipe_stack[0] = 0; } // +--------------------------------------------------------------------+ -- cgit v1.1