P2P SD: Avoid undefined behavior in pointer arithmetic