mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 07:24:37 +00:00
Create a null element and return it
This commit is contained in:
parent
5427e7f2ca
commit
7b756263c0
@ -113,7 +113,14 @@ namespace NetworkInterfaceManager
|
||||
DbgWriteScreen("DNS: %s", dhcp->DomainNameSystem.v4.ToStringLittleEndian());
|
||||
TaskManager->Sleep(200);
|
||||
|
||||
/* TODO: This is a quick workaround we need DNS resolver asap. IP is time-a-g.nist.gov; https://tf.nist.gov/tf-cgi/servers.cgi */
|
||||
/* TODO: This is a quick workaround we need DNS resolver asap.
|
||||
|
||||
https://tf.nist.gov/tf-cgi/servers.cgi
|
||||
https://www.ntppool.org
|
||||
|
||||
- 0.ro.pool.ntp.org ( {86, 127, 71, 168} )
|
||||
- time-a-g.nist.gov ( {129, 6, 15, 28} )
|
||||
*/
|
||||
InternetProtocol ip = {.v4 = {.Address = {129, 6, 15, 28}},
|
||||
.v6 = {.Address = {}}};
|
||||
NetworkUDP::Socket *NTP_Socket = udp->Connect(ip, 123);
|
||||
|
@ -149,7 +149,16 @@ public:
|
||||
VectorSize = Size;
|
||||
}
|
||||
|
||||
__no_instrument_function T &operator[](size_t Index) { return VectorBuffer[Index]; }
|
||||
__no_instrument_function T &operator[](size_t Index)
|
||||
{
|
||||
if (!reinterpret_cast<uintptr_t>(&VectorBuffer[Index]))
|
||||
{
|
||||
warn("operator[]( %lld ) is null (requested by %#lx)", Index, __builtin_return_address(0));
|
||||
static T null_elem;
|
||||
return null_elem;
|
||||
}
|
||||
return VectorBuffer[Index];
|
||||
}
|
||||
|
||||
__no_instrument_function Vector<T> &operator=(const Vector<T> &Vector)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user