Fix uninitialized memory usage when UPNP_GetValidIGD() returns 3

This commit is contained in:
Cameron Gutman
2018-10-20 18:31:33 -07:00
parent 9a95d075e6
commit dad9b01a6f
2 changed files with 35 additions and 32 deletions

View File

@@ -269,6 +269,10 @@ bool UPnPHandleDeviceList(struct UPNPDev* list, bool ipv6, bool enable)
printf("No UPnP device found!" NL);
return false;
}
else if (ret == 3) {
printf("No UPnP IGD found!" NL);
goto Exit;
}
else if (ret == 1) {
printf("Found a connected UPnP IGD" NL);
}
@@ -278,12 +282,6 @@ bool UPnPHandleDeviceList(struct UPNPDev* list, bool ipv6, bool enable)
// Even if we are able to add forwarding entries, go ahead and try NAT-PMP
success = false;
}
else if (ret == 3) {
printf("Found UPnP devices (assuming it's an IGD) (!)" NL);
// Even if we are able to add forwarding entries, go ahead and try NAT-PMP
success = false;
}
else {
printf("UPNP_GetValidIGD() failed: %d" NL, ret);
goto Exit;