aboutsummaryrefslogtreecommitdiff
path: root/primedev/server
diff options
context:
space:
mode:
authorJan <sentrycraft123@gmail.com>2024-06-20 16:42:17 +0200
committerGitHub <noreply@github.com>2024-06-20 16:42:17 +0200
commit26fffcfdbaa23def1d2ed0a15e53ed7907883083 (patch)
tree8b1d2b1a3e481d33a0c135ab33f0cc083244d991 /primedev/server
parent8e56367314315c53c8c7bede25e5900da9c9e31c (diff)
downloadNorthstarLauncher-26fffcfdbaa23def1d2ed0a15e53ed7907883083.tar.gz
NorthstarLauncher-26fffcfdbaa23def1d2ed0a15e53ed7907883083.zip
Remove invalid memset in ServerPresence (#709)
The use of sizeof is incorrect here since `this` is a pointer and sizeof is used on the pointer directly, instead of what the pointer points to. It seems to work without issue due to padding but could cause issues if an instanced class like `std::string` gets nulled.
Diffstat (limited to 'primedev/server')
-rw-r--r--primedev/server/serverpresence.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/primedev/server/serverpresence.h b/primedev/server/serverpresence.h
index 94ecfe6a..07c6fb55 100644
--- a/primedev/server/serverpresence.h
+++ b/primedev/server/serverpresence.h
@@ -19,10 +19,7 @@ public:
int m_iPlayerCount;
int m_iMaxPlayers;
- ServerPresence()
- {
- memset(this, 0, sizeof(this));
- }
+ ServerPresence() {}
ServerPresence(const ServerPresence* obj)
{