Update buffer length after resize