[Acc] [PATCH] fix buffer overflow and out-of-bounds access