JnCrMx / discord-game-sdk4j

Java bindings for Discord's Game SDK
MIT License
122 stars 23 forks source link

Make native calls more secure #6

Closed JnCrMx closed 3 years ago

JnCrMx commented 4 years ago

Keep track of native states in Java (and if possible also C) code to avoid crashes when e.g. destroying an already destroyed core. Just thrown an IllegalStateException or something comparable in such cases.

JnCrMx commented 3 years ago

Mostly already implemented in #28. Tracking C states seems kinda useless, as whoever uses reflections to access native functions directly, should know what they are doing.

Also, length limits for strings are (hopefully) enforced in Java code already.