The three assignments above this line are still broken - they assume
that byte offsets in one encoding directly map to byte offsets in
another encoding.
I'm fixing the length here because it is the one causing out-of-bounds
reads and is easy to fix. For the others we'd have to actually compute
new offsets.
SCNG(yy_cursor) = new_yy_start + (SCNG(yy_cursor) - SCNG(yy_start));
SCNG(yy_marker) = new_yy_start + (SCNG(yy_marker) - SCNG(yy_start));
SCNG(yy_text) = new_yy_start + (SCNG(yy_text) - SCNG(yy_start));
- SCNG(yy_limit) = new_yy_start + (SCNG(yy_limit) - SCNG(yy_start));
+ SCNG(yy_limit) = new_yy_start + length;
SCNG(yy_start) = new_yy_start;
}
SCNG(yy_cursor) = new_yy_start + (SCNG(yy_cursor) - SCNG(yy_start));
SCNG(yy_marker) = new_yy_start + (SCNG(yy_marker) - SCNG(yy_start));
SCNG(yy_text) = new_yy_start + (SCNG(yy_text) - SCNG(yy_start));
- SCNG(yy_limit) = new_yy_start + (SCNG(yy_limit) - SCNG(yy_start));
+ SCNG(yy_limit) = new_yy_start + length;
SCNG(yy_start) = new_yy_start;
}
--TEST--
zend multibyte (7)
---SKIPIF--
---XFAIL--
-https://bugs.php.net/bug.php?id=66582
--INI--
error_reporting=E_ALL & ~E_DEPRECATED
zend.multibyte=On
--TEST--
zend multibyte (9)
---SKIPIF--
---XFAIL--
-https://bugs.php.net/bug.php?id=66582
--INI--
error_reporting=E_ALL & ~E_DEPRECATED
zend.multibyte=On