fix another possible buffer overflow