Skip to content

Commit

Permalink
Prevent overflow with argument of lastIndexOf
Browse files Browse the repository at this point in the history
  • Loading branch information
romainbrenguier committed Dec 8, 2017
1 parent 04766b2 commit 985684a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ exprt string_constraint_generatort::add_axioms_for_last_index_of(
axioms.push_back(a3);

const exprt index1 = from_integer(1, index_type);
const plus_exprt from_index_plus_one(from_index, index1);
const exprt from_index_plus_one =
plus_exprt_with_overflow_check(from_index, index1);
const if_exprt end_index(
binary_relation_exprt(from_index_plus_one, ID_le, str.length()),
from_index_plus_one,
Expand Down

0 comments on commit 985684a

Please sign in to comment.