trace: fix a memory overrun

Subtle.