TheElectronWill / night-config

Powerful java configuration library for toml, yaml, hocon, json and in-memory configurations. Serialization/deserialization framework.
GNU Lesser General Public License v3.0
242 stars 28 forks source link

json files can have arbitrary data on the end of them #167

Closed nextdayy closed 6 months ago

nextdayy commented 7 months ago

following a json file (parsed using JsonFormat.fancyInstance().createParser()),

{
    "chicken": true,
    "cgow": false,
    "color": {
        "saturation": 1.0,
        "brightness": 1.0,
        "alpha": 1.0,
        "hue": 0.9346405,
        "class": "org.polyfrost.polyui.color.PolyColor"
    },
    "cow5": false,
    "added": false,
    "i": 0,
    "cow2": false
} hdeajdiowaghuieanbdcjsaklfbuiawdaufhuaia

arbitrary data can be placed at the end of the file and it still accepts it (I do not think it is processed, however). not sure if this is a massive issue but is unusual behavior - most parsers would reject the above for it.

TheElectronWill commented 7 months ago

That should be rejected, indeed. Thank you for reporting this bug!

nextdayy commented 6 months ago

thank you for the speedy fix!