[*] Hardened line bufferer

[+] Unstaged changes from last commit
This commit is contained in:
Reece Wilson 2022-02-19 11:50:14 +00:00
parent be7e9271e6
commit b29be7b2d5
3 changed files with 8 additions and 4 deletions

View File

@ -63,7 +63,7 @@ namespace Aurora::Async
for (auto &workItem : workItems)
{
auto dependency = std::reinterpret_pointer_cast<WorkItem>(workItem);
auto dependency = AuReinterpretCast<WorkItem>(workItem);
AU_LOCK_GUARD(dependency->lock);
if (dependency->HasFailed())
@ -263,7 +263,7 @@ namespace Aurora::Async
for (auto &waiter : this->waiters_)
{
std::reinterpret_pointer_cast<WorkItem>(waiter)->DispatchEx(true);
AuReinterpretCast<WorkItem>(waiter)->DispatchEx(true);
}
}
@ -278,7 +278,7 @@ namespace Aurora::Async
for (auto &waiter : this->waiters_)
{
std::reinterpret_pointer_cast<WorkItem>(waiter)->Fail();
AuReinterpretCast<WorkItem>(waiter)->Fail();
}
this->waiters_.clear();

View File

@ -135,7 +135,7 @@ namespace Aurora::Crypto::ECC
}
unsigned long actualSize = sharedSecret.size();
auto ret = x25519_shared_secret(&key_, &(std::reinterpret_pointer_cast<PublicCurve25519Impl>(partnerPublic)->GetKey()), sharedSecret.data(), &actualSize);
auto ret = x25519_shared_secret(&key_, &(AuReinterpretCast<PublicCurve25519Impl>(partnerPublic)->GetKey()), sharedSecret.data(), &actualSize);
if (ret != CRYPT_OK)
{
SysPushErrorCrypt("{}", ret);

View File

@ -51,6 +51,8 @@ namespace Aurora::IO::Character
while (this->buffer_.readPtr < this->buffer_.writePtr)
{
Memory::ByteBufferPushReadState _(this->buffer_, true);
if (*this->buffer_.readPtr != '\n')
{
this->buffer_.readPtr++;
@ -71,6 +73,7 @@ namespace Aurora::IO::Character
{
if (!AuTryInsert(ret, AuString(this->buffer_.base, this->buffer_.base + end)))
{
this->buffer_.flagReadError = true;
break;
}
@ -78,6 +81,7 @@ namespace Aurora::IO::Character
}
catch (...)
{
this->buffer_.flagReadError = true;
SysPushErrorCatch();
break;
}