Skip to content

fix: potential rces, reimplement java style exceptions, implement sane checking in netcode (#794)#886

Draft
izzint wants to merge 16 commits intosmartcmd:mainfrom
izzint:packet-fix
Draft

fix: potential rces, reimplement java style exceptions, implement sane checking in netcode (#794)#886
izzint wants to merge 16 commits intosmartcmd:mainfrom
izzint:packet-fix

Conversation

@izzint
Copy link

@izzint izzint commented Mar 7, 2026

fixes #794

This PR is not fully finished, going through netcode takes a lot of effort and there's more and more new stuff i keep finding, expect a full write-up here once this PR gets to a more complete and all-encompassing state.

Currently implements IOException, EOFException, RuntimeException, and IllegalArgumentException.
trying my best to fill in the voids left by 4j where these are supposed to fit, as well as finding new places to insert them.

For more details on the current state of this, please check the commit history.

Please keep in note that contributions from other people are extremely welcomed! ;]

@izzint izzint changed the title fix: reimplement java style exceptions, implement sane checking in netcode (#794) fix: fix potential rces, reimplement java style exceptions, implement sane checking in netcode (#794) Mar 7, 2026
@izzint izzint changed the title fix: fix potential rces, reimplement java style exceptions, implement sane checking in netcode (#794) fix: potential rces, reimplement java style exceptions, implement sane checking in netcode (#794) Mar 8, 2026
@izzint
Copy link
Author

izzint commented Mar 8, 2026

keep in note some of the parts where there used to be c style casts have been converted to more modern c++ static_casts, functions identically in my testing though ;]

@izzint
Copy link
Author

izzint commented Mar 8, 2026

in its current state this shouldn't be merged, error checking is currently a little harsh and throws on launch (probably a root of a deeper problem because the throws only trigger when something weird happens in the respective function its in)

@void2012
Copy link
Collaborator

void2012 commented Mar 8, 2026

There is absolutely no need to introduce new exceptions — they bloat the unwinding and make the code more complicated.

@izzint
Copy link
Author

izzint commented Mar 8, 2026

if you have any ideas on implementing a system to gracefully clients who invalidate the checks id gladly appreciate it! probably not the best idea to tie it into exceptions but it wouldn't be hard to move away from them at all.

@izzint
Copy link
Author

izzint commented Mar 8, 2026

if you have any ideas on implementing a system to gracefully clients who invalidate the checks id gladly appreciate it! probably not the best idea to tie it into exceptions but it wouldn't be hard to move away from them at all.

no yeah this is way simpler than i made it out to be, 4j codebase design proves to never work in anyones favour, period

@izzint
Copy link
Author

izzint commented Mar 8, 2026

will get back to this tommorow

@void2012
Copy link
Collaborator

void2012 commented Mar 8, 2026

If so, try finding a solution that doesn't involve exceptions, if possible.

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.

[Bug, Security] potential security problems with Packet class, asserts in general

3 participants