fix: validate the user inputs and add documentation for the CLI
Fixes #16
@lefticus Could you take a look at this? The user input verification is quite important in terms of security.
@lefticus A kind reminder on this if you have missed it. These security issues are important.
@aminya since invalid input would result in generated code that cannot compile, I'm curious how this qualifies as a security issue. Could you provide an example for how invalid input can generate code that compiles and is dangerous or in some way compromises the generator itself?
@aminya since invalid input would result in generated code that cannot compile, I'm curious how this qualifies as a security issue. Could you provide an example for how invalid input can generate code that compiles and is dangerous or in some way compromises the generator itself?
Fortunately, the generated code does not seem to be affected. However, the json2cpp CLI itself still segfaults, and if in some situations it is exposed to receive user input, it can allow access to the memory.
This PR also solves the usability issue for developers. Previously, the failures were silent or could result in segfaults.