fix uninitialized endFile buffer use bug