trailofbits / uthenticode

A cross-platform library for verifying Authenticode signatures
https://trailofbits.github.io/uthenticode/
MIT License
139 stars 33 forks source link

Shouldn't this instance here be a std::make_unique? #105

Closed hugmyndakassi closed 1 month ago

hugmyndakassi commented 1 month ago

This instance in WinCert::as_signed_data():

return std::unique_ptr<SignedData>(new SignedData(cert_buf_));
woodruffw commented 1 month ago

My understanding is that std::unique_ptr's ctor and std::make_unique are semantically equivalent, so there's no harm in the current form. But using make_unique with argument forwarding is maybe a little more idiomatic? If that's the case, feel free to send a PR 🙂

hugmyndakassi commented 1 month ago

That's what I meant. And as far as I understand it there is one edge case where they behave differently, but that's mostly important when passing unique pointers into an argument list (not the case here).