From 773d750f5cab1231dbf3922487f95dcddb55b98a Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Fri, 28 Jan 2011 12:11:08 +0000 Subject: [PATCH] Fixed possible read to invalid memory location (thanks to Alexander Konovalov). --- src/word.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/word.cpp b/src/word.cpp index 1c1c1a6b..fa08d33f 100644 --- a/src/word.cpp +++ b/src/word.cpp @@ -460,7 +460,7 @@ void word::generate(utility::outputStream& os, const string::size_type maxLineLe os << string(curLineStart, p); - if (parserHelpers::isSpace(*(p - 1))) + if (p != m_buffer.begin() && parserHelpers::isSpace(*(p - 1))) state->lastCharIsSpace = true; else state->lastCharIsSpace = false;