Skip to content

Commit

Permalink
Make ClientInterface::statenames consistent with the state enum again
Browse files Browse the repository at this point in the history
Fixes minetest.get_player_information segfault due
to out of bounds access problems, when compiled as debug build.
  • Loading branch information
est31 committed Aug 31, 2015
1 parent 9c44aac commit 2c637ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/clientiface.cpp
Expand Up @@ -38,10 +38,12 @@ const char *ClientInterface::statenames[] = {
"Disconnecting",
"Denied",
"Created",
"InitSent",
"AwaitingInit2",
"HelloSent",
"InitDone",
"DefinitionsSent",
"Active"
"Active",
"SudoMode",
};


Expand Down
3 changes: 3 additions & 0 deletions src/clientiface.h
Expand Up @@ -167,6 +167,9 @@ namespace con {

#define CI_ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0]))

// Also make sure to update the ClientInterface::statenames
// array when modifying these enums

enum ClientState
{
CS_Invalid,
Expand Down

0 comments on commit 2c637ce

Please sign in to comment.