diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c index b340120..94147f0 100644 --- a/upnp/src/api/upnpapi.c +++ b/upnp/src/api/upnpapi.c @@ -1012,7 +1012,7 @@ int UpnpRegisterRootDevice3( struct Handle_Info *HInfo; int retVal = 0; int hasServiceTable = 0; - + int handler_index = 0; HandleLock(); UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, @@ -1041,7 +1041,7 @@ int UpnpRegisterRootDevice3( /* Test for already registered IPV6. IPV6 devices might register on multiple * IPv6 addresses (link local and GUA or ULA), so we must to check the * description URL in the HandleTable. */ - int handler_index = 0; + while (handler_index < NUM_HANDLE && HandleTable[handler_index] != NULL) { if (strcmp(((struct Handle_Info *)HandleTable[handler_index])->DescURL, DescUrl)) { retVal = UPNP_E_ALREADY_REGISTERED; diff --git a/upnp/src/ssdp/ssdp_device.c b/upnp/src/ssdp/ssdp_device.c index 3624ebf..1b52178 100644 --- a/upnp/src/ssdp/ssdp_device.c +++ b/upnp/src/ssdp/ssdp_device.c @@ -421,6 +421,7 @@ void CreateServicePacket( } } else if (msg_type == MSGTYPE_ADVERTISEMENT || msg_type == MSGTYPE_SHUTDOWN) { + char *host = NULL; if (msg_type == MSGTYPE_ADVERTISEMENT) { nts = "ssdp:alive"; } else { @@ -429,7 +430,7 @@ void CreateServicePacket( } /* NOTE: The CACHE-CONTROL and LOCATION headers are not present in * a shutdown msg, but are present here for MS WinMe interop. */ - char *host = NULL; + if (AddressFamily == AF_INET) { host = SSDP_IP; } else {