diff --git a/libtransmission/magnet.c b/libtransmission/magnet.c index 6ccd9191f..bff04c29a 100644 --- a/libtransmission/magnet.c +++ b/libtransmission/magnet.c @@ -151,10 +151,10 @@ tr_magnetParse( const char * uri ) if( ( keylen==2 ) && !memcmp( key, "dn", 2 ) ) displayName = tr_http_unescape( val, vallen ); - if( ( keylen==2 ) && !memcmp( key, "tr", 2 ) ) + if( ( keylen==2 ) && !memcmp( key, "tr", 2 ) && ( trCount < MAX_TRACKERS ) ) tr[trCount++] = tr_http_unescape( val, vallen ); - if( ( keylen==2 ) && !memcmp( key, "ws", 2 ) ) + if( ( keylen==2 ) && !memcmp( key, "ws", 2 ) && ( wsCount < MAX_TRACKERS ) ) ws[wsCount++] = tr_http_unescape( val, vallen ); walk = next != NULL ? next + 1 : NULL;