From c92048fefb474f5ab8afc744b94257891cf974bf Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 27 Nov 2007 17:25:16 +0000 Subject: [PATCH] fixed a rare parsing bug where too many tokens would be detected if the staging buffer was broken directly before the second quotation mark in a key string --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401736 --- core/TextParsers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/TextParsers.cpp b/core/TextParsers.cpp index 73f65b12..51c23227 100644 --- a/core/TextParsers.cpp +++ b/core/TextParsers.cpp @@ -408,8 +408,8 @@ SMCError TextParsers::ParseStream_SMC(void *stream, { if (in_quote) { - /* If i was 0, this case is impossible due to reparsing */ - if ((i != 0) && c == '"' && parse_point[i-1] != '\\') + /* If i was 0, we could have reparsed, so make sure there's no buffer underrun */ + if ((&parse_point[i] != in_buf) && c == '"' && parse_point[i-1] != '\\') { /* If we reached a quote in an ignore phase, * we're staging a string and we must rotate it out.