From 8154fb4897d60a9f11e27a6f9cc28b1e39247c86 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 29 Sep 2007 22:11:21 +0000 Subject: [PATCH] fixed amb988 - stack corruption in text parser. stack variables are moved to better detect pointer corruption now --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401509 --- core/TextParsers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/TextParsers.cpp b/core/TextParsers.cpp index 021ede39..a9e07cb8 100644 --- a/core/TextParsers.cpp +++ b/core/TextParsers.cpp @@ -279,8 +279,8 @@ SMCParseError TextParsers::ParseStream_SMC(void *stream, unsigned int *line, unsigned int *col) { - char in_buf[4096]; char *reparse_point = NULL; + char in_buf[4096]; char *parse_point = in_buf; char *line_begin = in_buf; unsigned int read; @@ -301,7 +301,7 @@ SMCParseError TextParsers::ParseStream_SMC(void *stream, smc->ReadSMC_ParseStart(); - while (srdr(stream, parse_point, sizeof(in_buf) - (parse_point - line_begin) - 1, &read)) + while (srdr(stream, parse_point, sizeof(in_buf) - (parse_point - in_buf) - 1, &read)) { if (!read) {