Openspades: Game crashes if team names contain spaces

Created on 15 Apr 2018  Â·  6Comments  Â·  Source: yvt/openspades

OpenSpades crashes if team names contain spaces where the original game does not. I have isolated the issue with crashing regarding my server as being due to spaces in the team names.

bug

Most helpful comment

Team names are not allowed to be that long. The space is not the problem - you can put any other letter there and it will still crash.
The longest valid name is 9 letters: TeamAmeri (and then one more for the \0).
Pyspades should not let you make a name longer and should not send invalid packets.
OpenSpades could stop crashing and could even handle the invalid packet properly (read 10 chars and if there's no null, keep reading), but it will still be broken for voxlap players.

All 6 comments

Crashes even when you set team 1's name to "aaaaaaaaaaa" (11 'a's) and team 2's name to "bbbbbbbbbbb" (11 'b's).

https://piqueserver.github.io/aosprotocol/protocol075.html#state-data
Spec. says team names should be 10 characters long. Length might be causing the issue.

What team names did you test with?

Even with the team names being too long it didn’t crash unless the space was present (Team America vs. TeamAmerica)
TeamAmerica did not crash the game even though it is eleven characters.

Sent from my iPhone

On Apr 18, 2018, at 3:41 PM, Joseph Daniel <[email protected]notifications@github.com> wrote:

Crashes even when you set team 1's name to "aaaaaaaaaaa" (11 'a's) and team 2's name to "bbbbbbbbbbb" (11 'b's).

https://piqueserver.github.io/aosprotocol/protocol075.html#state-data
Spec. says team names should be 10 characters long. Length might be causing the issue.

What team names did you test with?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/yvt/openspades/issues/737#issuecomment-382505474, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFP6KKFEghHnXS0d4i8fZZpjYkNA8_4Mks5tp5b4gaJpZM4TVkOd.

Team names are not allowed to be that long. The space is not the problem - you can put any other letter there and it will still crash.
The longest valid name is 9 letters: TeamAmeri (and then one more for the \0).
Pyspades should not let you make a name longer and should not send invalid packets.
OpenSpades could stop crashing and could even handle the invalid packet properly (read 10 chars and if there's no null, keep reading), but it will still be broken for voxlap players.

Voxlap experienced no crashes with the names in my testing and even though the names were still too long without the space neither openspades nor voxlap crashed in my testing.

Sent from my iPhone

On Apr 20, 2018, at 6:45 PM, BR- <[email protected]notifications@github.com> wrote:

Team names are not allowed to be that long. The space is not the problem - you can put any other letter there and it will still crash.
The longest valid name is 9 letters: TeamAmeri (and then one more for the \0).
Pyspades should not let you make a name longer and should not send invalid packets.
OpenSpades could stop crashing and could even handle the invalid packet properly (read 10 chars and if there's no null, keep reading), but it will still be broken for voxlap players.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/yvt/openspades/issues/737#issuecomment-383241146, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFP6KC4MAKrkB8E3d48vDEScBXSyEnSRks5tqmTvgaJpZM4TVkOd.

It breaks intel/tent spawning.

@Irup @BR-

OpenSpades could stop crashing and could even handle the invalid packet properly (read 10 chars and if there's no null, keep reading), but it will still be broken for voxlap players.

OpenSpades can naturally handle that (specifically, a lack of null characters in a fixed-length string field).

https://github.com/yvt/openspades/blob/995e7f2ffcb1d02aa699e2b1b9c73502544e9e62/Sources/Client/NetClient.cpp#L235-L241

Illegally long team names alters the structure of the packet, causing invalid values being read from other fields, e.g., team/player IDs. Since NetClient does not perform validation on a majority of those fields, various subsystems would consume those unvalidated values. The crash may have been caused by that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Danogot516 picture Danogot516  Â·  3Comments

Rafael450 picture Rafael450  Â·  6Comments

kmsiapps picture kmsiapps  Â·  5Comments

100best picture 100best  Â·  8Comments

CarbonCookies picture CarbonCookies  Â·  7Comments