2
0
mirror of https://github.com/boostorg/wave.git synced 2026-02-22 03:42:24 +00:00

Fixed a rare memory corruption bug in the Wave Re2C scanner buffer management code.

[SVN r33831]
This commit is contained in:
Hartmut Kaiser
2006-04-26 20:51:54 +00:00
parent fd28184ffd
commit b5bcbcba4f
4 changed files with 6 additions and 5 deletions

View File

@@ -194,7 +194,7 @@ uchar *fill(Scanner *s, uchar *cursor)
{
if (NULL == s->lim)
s->lim = s->top;
memcpy(s->bot, s->tok, s->lim - s->tok);
memmove(s->bot, s->tok, s->lim - s->tok);
s->tok = s->cur = s->bot;
s->ptr -= cnt;
cursor -= cnt;
@@ -218,7 +218,7 @@ uchar *fill(Scanner *s, uchar *cursor)
return cursor;
}
memcpy(buf, s->tok, s->lim - s->tok);
memmove(buf, s->tok, s->lim - s->tok);
s->tok = s->cur = buf;
s->ptr = &buf[s->ptr - s->bot];
cursor = &buf[cursor - s->bot];
@@ -238,7 +238,7 @@ uchar *fill(Scanner *s, uchar *cursor)
cnt = s->last - s->act;
if (cnt > BOOST_WAVE_BSIZE)
cnt = BOOST_WAVE_BSIZE;
memcpy(s->lim, s->act, cnt);
memmove(s->lim, s->act, cnt);
s->act += cnt;
if (cnt != BOOST_WAVE_BSIZE)
{

View File

@@ -1,4 +1,4 @@
/* Generated by re2c 0.10.0 on Mon Mar 20 11:46:13 2006 */
/* Generated by re2c 0.10.0 on Wed Apr 26 15:42:21 2006 */
#line 1 "cpp.re"
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library

View File

@@ -1,4 +1,4 @@
/* Generated by re2c 0.10.0 on Mon Mar 20 11:46:13 2006 */
/* Generated by re2c 0.10.0 on Wed Apr 26 15:42:21 2006 */
#line 1 "strict_cpp.re"
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library