[IPCONFIG] Fix crash on 'ipconfig /all'

Ipconfig should not display invalid 'Lease Obtained' and  'Lease Expires' times because it did not yet receive any DHCP configuration.

Fixes CORE-11837
This commit is contained in:
Eric Kohl 2019-06-12 17:48:35 +02:00
parent 6866c0aede
commit 6734d4ca09

View file

@ -543,7 +543,7 @@ VOID ShowInfo(BOOL bAll)
_tprintf(_T("\tSecondary WINS Server . . . . . . : %s\n"), pAdapter->SecondaryWinsServer.IpAddress.String);
}
if (pAdapter->DhcpEnabled)
if (pAdapter->DhcpEnabled && _tcscmp(pAdapter->DhcpServer.IpAddress.String, _T("255.255.255.255")))
{
_tprintf(_T("\tLease Obtained. . . . . . . . . . : %s"), _tasctime(localtime(&pAdapter->LeaseObtained)));
_tprintf(_T("\tLease Expires . . . . . . . . . . : %s"), _tasctime(localtime(&pAdapter->LeaseExpires)));