Skip to content

Commit

Permalink
fix: crash when allocating too much data in a single packet
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamashi committed Feb 9, 2022
1 parent 1c90f7f commit d672708
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Code/encoding/Structs/ActionEvent.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <Structs/ActionEvent.h>
#include <TiltedCore/Serialization.hpp>
#include <sstream>
#include <TiltedCore/StackAllocator.hpp>

using TiltedPhoques::Serialization;

Expand Down Expand Up @@ -63,6 +64,10 @@ void ActionEvent::Load(std::istream& aInput)

void ActionEvent::GenerateDifferential(const ActionEvent& aPrevious, TiltedPhoques::Buffer::Writer& aWriter) const noexcept
{
TiltedPhoques::StackAllocator<1 << 16> s_allocator;

TiltedPhoques::ScopedAllocator _(s_allocator);

uint8_t flags = 0;

if (ActionId != aPrevious.ActionId)
Expand Down

0 comments on commit d672708

Please sign in to comment.