fix stack overflow in reader, #TRDR-11

Signed-off-by: Bronsa <brobronsa@gmail.com>