log: fix memory overread issue