fix buffer overflow introduced with r8876