From 10f4cf978812ae152484401e0f3841c50a8aa329 Mon Sep 17 00:00:00 2001 From: Julio Cavalin Date: Wed, 10 Apr 2024 15:12:50 +0100 Subject: [PATCH] feature flags --- feature-flag.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/feature-flag.c b/feature-flag.c index 0833f79..789b404 100644 --- a/feature-flag.c +++ b/feature-flag.c @@ -49,5 +49,9 @@ void feature_flag_save(const struct feature_flag *feature_flag, unsigned const c } void feature_flag_load(struct feature_flag *feature_flag, unsigned const char key[KDF_HASH_LEN]) { - feature_flag->url_encryption_enabled = !strcmp(config_read_encrypted_string("session_ff_url_encryption", key), "1"); + char * ff_url_encryption = config_read_encrypted_string("session_ff_url_encryption", key); + + if (ff_url_encryption != NULL) { + feature_flag->url_encryption_enabled = !strcmp(ff_url_encryption, "1"); + } }