From f5e59ae00eda2cd8ef9f2392d7bfa6b85c7981f1 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 17 Aug 2022 18:03:17 +0300 Subject: [PATCH 31/31] Fix NULL dereference in entry_bool_get() See osdn #45008 Signed-off-by: Marko Lindqvist --- utility/registry_ini.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utility/registry_ini.c b/utility/registry_ini.c index e466a91af5..6f16c69e08 100644 --- a/utility/registry_ini.c +++ b/utility/registry_ini.c @@ -3408,7 +3408,7 @@ static inline void entry_use(struct entry *pentry) } /**********************************************************************//** - Gets an boolean value. Returns TRUE on success. + Gets an boolean value. Returns TRUE on success. On old saved files, 0 and 1 can also be considered as bool. **************************************************************************/ bool entry_bool_get(const struct entry *pentry, bool *value) @@ -3425,7 +3425,9 @@ bool entry_bool_get(const struct entry *pentry, bool *value) return TRUE; } - SECFILE_RETURN_VAL_IF_FAIL(pentry->psection->secfile, pentry->psection, + SECFILE_RETURN_VAL_IF_FAIL(pentry->psection != NULL + ? pentry->psection->secfile : NULL, + pentry->psection, ENTRY_BOOL == pentry->type, FALSE); if (NULL != value) { -- 2.35.1