mirror of
https://github.com/transmission/transmission
synced 2025-03-06 03:28:33 +00:00
fix crash reported by hussam in #transmission
This commit is contained in:
parent
6253979516
commit
dc6a7b9485
1 changed files with 7 additions and 5 deletions
|
@ -7,7 +7,7 @@
|
|||
* This exemption does not extend to derived works not owned by
|
||||
* the Transmission project.
|
||||
*
|
||||
* $Id:$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <stdio.h> /* printf */
|
||||
|
@ -70,10 +70,12 @@ tr_upnpStart( tr_upnp * handle )
|
|||
{
|
||||
char portStr[16];
|
||||
snprintf( portStr, sizeof(portStr), "%d", handle->port );
|
||||
handle->isForwarding = UPNP_AddPortMapping( handle->urls.controlURL,
|
||||
handle->data.servicetype,
|
||||
portStr, portStr, handle->lanaddr,
|
||||
"Transmission", "TCP" );
|
||||
handle->isForwarding = ( handle->urls.controlURL != NULL ) &&
|
||||
( handle->data.servicetype != NULL ) &&
|
||||
( UPNP_AddPortMapping( handle->urls.controlURL,
|
||||
handle->data.servicetype,
|
||||
portStr, portStr, handle->lanaddr,
|
||||
"Transmission", "TCP" ) );
|
||||
|
||||
tr_dbg( "UPNP Port Forwarding via '%s', service '%s'. (local address: %s:%d)",
|
||||
handle->urls.controlURL, handle->data.servicetype, handle->lanaddr, handle->port );
|
||||
|
|
Loading…
Add table
Reference in a new issue