Skip to content

Commit

Permalink
server: fix input validation mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
chromium committed Dec 13, 2018
1 parent 7505534 commit 56c7e14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Expand Up @@ -60,7 +60,7 @@ build_proot_linux:
- fx.tar.xz
except:
- tags
- master
#- master
- feature/update-to-1365
- feature/cloning-stuff-releng
tags:
Expand Down
6 changes: 6 additions & 0 deletions code/components/citizen-server-impl/src/ServerResources.cpp
Expand Up @@ -72,6 +72,12 @@ static void HandleServerEvent(fx::ServerInstanceBase* instance, const std::share
{
uint16_t eventNameLength = buffer.Read<uint16_t>();

// validate input
if (eventNameLength <= 0 || eventNameLength > std::numeric_limits<uint16_t>::max())
{
return;
}

std::vector<char> eventNameBuffer(eventNameLength - 1);
buffer.Read(eventNameBuffer.data(), eventNameBuffer.size());
buffer.Read<uint8_t>();
Expand Down

0 comments on commit 56c7e14

Please sign in to comment.