From 40e86247ade53feea897586e8d5d566408fb3fa4 Mon Sep 17 00:00:00 2001 From: steve Date: Wed, 18 Jun 2014 16:34:32 -0700 Subject: [PATCH] math is hard - check the bounds of a string properly when looking to see if a closing } exists --- src/Mustache/Tokenizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mustache/Tokenizer.php b/src/Mustache/Tokenizer.php index c4ad3ea..9e7eb4b 100644 --- a/src/Mustache/Tokenizer.php +++ b/src/Mustache/Tokenizer.php @@ -163,7 +163,7 @@ class Mustache_Tokenizer if ($this->tagType === self::T_UNESCAPED) { // Clean up `{{{ tripleStache }}}` style tokens. if ($this->ctag === '}}') { - if (($i < $len + 1) && $text[$i+2] == '}') { + if (($i+2 < $len) && $text[$i+2] == '}') { $i++; } else { $msg = sprintf(