EZC: fix off-by-one heap overflow in test function

Detected with ASan.