settings: Overwrite values before freeing memory
PATCH 1/1 settings: Overwrite values before freeing memory
Since there may be sensitive data in the setting values, wipe the value memory before freeing.
--- ell/settings.c | 1 + 1 file changed, 1 insertion(+)
ell/settings.c +1 -0
@@ -61,6 +61,7 @@ static void setting_destroy(void *data)struct setting_data *pair = data;l_free (pair->key); +memset (pair->value,0 ,strlen (pair->value));l_free (pair->value);l_free (pair); }
Signature · 1 line
2.14.1
Denis Kenzior
AppliedHi Andrew,
Quoted 6 lines · Andrew Zaborowski
Since there may be sensitive data in the setting values, wipe the value memory before freeing.
--- ell/settings.c | 1 + 1 file changed, 1 insertion(+)
Applied, thanks.
Regards,
-Denis
Quoted 11 lines · Andrew Zaborowski
Since there may be sensitive data in the setting values, wipe the value memory before freeing.
---ell/settings.c| 1 +1 file changed, 1 insertion(+)ell/settings.c +0
-0
ell/settings.c static void setting_destroy(void *data) · line 64
Quoted 4 lines
ell/settings.c +1
-0@@ -61,6 +61,7 @@ static void setting_destroy(void *data)struct setting_data *pair = data;l_free (pair->key); +memset (pair->value,0 ,strlen (pair->value));
l_free can handle pair->value == NULL, but strlen and memset can't. Is it worth checking for that?
Quoted 11 lines
ell/settings.c +0
-0l_free (pair->value);l_free (pair); }Signature · 6 lines
2.14.1 _______________________________________________ ell mailing list ell(a)lists.01.org https://lists.01.org/mailman/listinfo/ell
--
Mat Martineau
Intel OTC
Hi Mat,
Quoted 6 lines
Quoted 2 lines
l_free(pair->key);
+memset(pair->value, 0, strlen(pair->value));
l_freecan handlepair->value== NULL, but strlen and memset can't. Is it worth checking for that?
pair->value is always validated to be not NULL, so strictly speaking this isn't necessary. We could opt to be paranoid of course...
Regards,
-Denis