mirror of
https://github.com/transmission/transmission
synced 2024-12-29 02:56:11 +00:00
fix: in check input before calling tr_sha1_from_string() (#2468)
Fixes #2467
This commit is contained in:
parent
4833723651
commit
da4ad59290
1 changed files with 3 additions and 2 deletions
|
@ -2833,6 +2833,7 @@ void tr_sessionRemoveTorrent(tr_session* session, tr_torrent* tor)
|
||||||
|
|
||||||
tr_torrent* tr_session::getTorrent(std::string_view info_dict_hash_string)
|
tr_torrent* tr_session::getTorrent(std::string_view info_dict_hash_string)
|
||||||
{
|
{
|
||||||
auto info_dict_hash = tr_sha1_from_string(std::data(info_dict_hash_string));
|
return std::size(info_dict_hash_string) == TR_SHA1_DIGEST_STRLEN ?
|
||||||
return this->getTorrent(info_dict_hash);
|
this->getTorrent(tr_sha1_from_string(info_dict_hash_string)) :
|
||||||
|
nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue