Added a test for out-of-bounds character array access.

Hi,

While looking at ticket #5615, I noticed a femto optimization and more importantly that we did not have any unit test for out-of-bounds character array access. This patch fixes this. Thanks to consider merging.

Cheers,
  Simon