Skip to content

Commit

Permalink
Fix Dangerous default value DEFAULT_CONFIG (builtins.dict) as argument
Browse files Browse the repository at this point in the history
Signed-off-by: TheBossMagnus <[email protected]>
  • Loading branch information
TheBossMagnus committed Feb 21, 2024
1 parent efb80c1 commit f126c54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ def create_config():
logging.error("ERROR: Unable to create the config.json in %s. Try running as administrator", os.getcwd())
sys.exit(1)

def validate_config(config, default_config=DEFAULT_CONFIG):
def validate_config(config, default_config):
"""Check if all the fields are present and are of the correct type"""

if not isinstance(config, dict):
raise ValueError("Config must be a dictionary")
for key, default_value in default_config.items():
Expand Down

0 comments on commit f126c54

Please sign in to comment.