Skip to content

Prevent packets from having dangerously sized collections (Electric Boogaloo)#125

Merged
Protonull merged 12 commits intoCivPlatform:mainfrom
Protonull:fix-oversized-packet-crash
Mar 26, 2026
Merged

Prevent packets from having dangerously sized collections (Electric Boogaloo)#125
Protonull merged 12 commits intoCivPlatform:mainfrom
Protonull:fix-oversized-packet-crash

Conversation

@Protonull
Copy link
Copy Markdown
Collaborator

This PR will implement #121

@Protonull Protonull force-pushed the fix-oversized-packet-crash branch 2 times, most recently from 7c1505d to 37be1cf Compare March 24, 2026 10:53
These had a weird mixture of interface and namespace. They've now just been replaced with classes and each consolidated into one file.
Turns out that doing an aggregate function like MAX without having a group by, in this case, is a *bad* idea. Also I seemed to have forgotten that regions are 32x32, not 16x16 :s
This also involved switching over to a typed-ish bigint system, which means switching over the database to use them, etc.
This is one of the drawbacks of Java's refusal to support unsigned integers: casting a value from one integer type to another actually changes its binary structure.
@Protonull Protonull force-pushed the fix-oversized-packet-crash branch from 37be1cf to f8ba925 Compare March 26, 2026 19:34
@Protonull
Copy link
Copy Markdown
Collaborator Author

This took a little longer than expected as I began fretting about ensuring that any u5 value is actually a valid u5, etc, but I believe it's about ready to merge.

@Protonull Protonull marked this pull request as ready for review March 26, 2026 19:39
@Protonull Protonull merged commit e1b8c11 into CivPlatform:main Mar 26, 2026
2 checks passed
@Protonull Protonull deleted the fix-oversized-packet-crash branch March 26, 2026 19:41
@Protonull Protonull mentioned this pull request Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant