Skip to content
Snippets Groups Projects
Closed Error returned by UPnPContext::getAvailablePortNumber not handled correctly
  • View options
  • Error returned by UPnPContext::getAvailablePortNumber not handled correctly

  • View options
  • Closed Issue created by François-Simon Fauteux-Chapleau

    The UPnPContext::getAvailablePortNumber function returns 0 if it can't find an available port number, but this case isn't handled correctly in the following two functions:

    • UPnPContext::provisionNewMappings simply calls getAvailablePortNumber again whenever this happens, which can lead to an infinite loop;
    • UPnPContext::registerMapping doesn't check whether the port number it got is zero or not, so it will go ahead and request a port mapping with internal and external port numbers set to 0, which is invalid.

    Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first