Skip to content

Commit 26fffcf

Browse files
authored
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.
1 parent 8e56367 commit 26fffcf

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

primedev/server/serverpresence.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ struct ServerPresence
1919
int m_iPlayerCount;
2020
int m_iMaxPlayers;
2121

22-
ServerPresence()
23-
{
24-
memset(this, 0, sizeof(this));
25-
}
22+
ServerPresence() {}
2623

2724
ServerPresence(const ServerPresence* obj)
2825
{

0 commit comments

Comments
 (0)