mirror of
https://github.com/transmission/transmission
synced 2025-03-04 02:28:03 +00:00
(trunk) bounds check trackerIds passed over rpc
This commit is contained in:
parent
2f5207357b
commit
3ebe5d8f27
1 changed files with 6 additions and 2 deletions
|
@ -872,7 +872,8 @@ replaceTrackers( tr_torrent * tor, tr_benc * urls )
|
|||
if( tr_bencGetInt( pair[0], &pos )
|
||||
&& tr_bencGetStr( pair[1], &newval )
|
||||
&& tr_urlIsValid( newval, -1 )
|
||||
&& pos < n )
|
||||
&& pos < n
|
||||
&& pos >= 0 )
|
||||
{
|
||||
tr_free( trackers[pos].announce );
|
||||
trackers[pos].announce = tr_strdup( newval );
|
||||
|
@ -916,7 +917,10 @@ removeTrackers( tr_torrent * tor, tr_benc * ids )
|
|||
while(( val = tr_bencListChild( ids, i++ )))
|
||||
{
|
||||
int64_t pos;
|
||||
if( tr_bencGetInt( val, &pos ) && pos < n )
|
||||
|
||||
if( tr_bencGetInt( val, &pos )
|
||||
&& pos < n
|
||||
&& pos >= 0 )
|
||||
tids[t++] = pos;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue