Fix reading heap overflow in a test case