1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

(trunk libT) #4504 "crash when adding malformed magnet link" -- fixed.

This commit is contained in:
Jordan Lee 2011-09-25 21:51:50 +00:00
parent 4522a3c055
commit 5332d234bb

View file

@ -149,10 +149,10 @@ tr_magnetParse( const char * uri )
}
}
if( ( keylen==2 ) && !memcmp( key, "dn", 2 ) )
if( ( vallen > 0 ) && ( keylen==2 ) && !memcmp( key, "dn", 2 ) )
displayName = tr_http_unescape( val, vallen );
if( trCount < MAX_TRACKERS ) {
if( ( vallen > 0 ) && ( trCount < MAX_TRACKERS ) ) {
int i;
if( ( keylen==2 ) && !memcmp( key, "tr", 2 ) )
tr[trCount++] = tr_http_unescape( val, vallen );