From dcc0ab19c24927c52e80849b009aa33e62226616 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 11 Sep 2011 11:46:19 -0400 Subject: [PATCH] Bug - Fixed crash bug on Linux where Command::next_mod_group just walked off the end of a vector. --- src/commands/Command.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index 624017b5d..ea34a77af 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -555,8 +555,9 @@ bool Command::next_mod_group (const A3& input, Arg& arg, unsigned int& pos) if (arg._type == Arg::type_date && arg._category == Arg::cat_attr) { - while (input[pos]._type == Arg::type_duration || - input[pos]._category == Arg::cat_op) + while (pos < input.size () && + (input[pos]._type == Arg::type_duration || + input[pos]._category == Arg::cat_op)) { arg._raw += " " + input[pos++]._raw; }