In sspi_handshake::operator()(), extra buffer handling section should have std::copy, not std::move
mscottmueller opened this issue · 3 comments
mscottmueller commented
const auto extra_data_begin = input_data_.begin() + previous_size - extra_size;
const auto extra_data_end = input_data_.begin() + previous_size;
std::move(extra_data_begin, extra_data_end, input_data_.begin());
Should be
const auto extra_data_begin = input_data_.begin() + previous_size - extra_size;
const auto extra_data_end = input_data_.begin() + previous_size;
std::copy(extra_data_begin, extra_data_end, input_data_.begin());
laudrup commented
@mscottmueller Thanks a lot for your interest in this project.
Not that I think you're wrong in any way but do you think you could explain why std::move
is incorrect in this case?
I remember being quite certain that the regions couldn't overlap but I could very well be wrong.
You are also very welcome to open a pull request with the explanation in the commit message.
Thanks.
mscottmueller commented
Oh I see. I was confused because #include <algorithm> was not in place. Yes, std::move should be okay.
Best Regards,
M. Scott Mueller
On Jun 1, 2022, at 12:56 PM, Kasper Laudrup ***@***.***> wrote:
CAUTION - This message originated outside AVEVA
@mscottmueller<https://github.com/mscottmueller> Thanks a lot for your interest in this project.
Not that I think you're wrong in any way but do you think you could explain why std::move is incorrect in this case?
I remember being quite certain that the regions couldn't overlap but I could very well be wrong.
You are also very welcome to open a pull request with the explanation in the commit message.
Thanks.
—
Reply to this email directly, view it on GitHub<#51 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADHPESEWAK54WR7BPQIBBGLVM6567ANCNFSM5XRYBH7A>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
…__________________________________________________________________
AVEVA Group plc is registered in England at High Cross, Madingley Road, Cambridge, England CB3 0HB. Number 2937296.
laudrup commented
The algorithm header should probably be included anyway but that would also be the case with std::copy
.
I'm quite sure there are quite a few missing headers other places as well though. This is not a public header though so I don't consider it to be too much of an issue.