Mercurial > pidgin
diff libpurple/prefs.c @ 31751:6da9e43e17d8
prefs: Avoid an atoi(NULL) when reading the prefs from disk
Clang identified that no value attribute lead to an unconditional NULL deref here
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Thu, 21 Jul 2011 03:16:51 +0000 |
parents | 351d07aefb09 |
children | ae0fa8a95fd9 |
line wrap: on
line diff
--- a/libpurple/prefs.c Wed Jul 20 16:51:55 2011 +0000 +++ b/libpurple/prefs.c Thu Jul 21 03:16:51 2011 +0000 @@ -277,6 +277,12 @@ } } + if ((pref_type == PURPLE_PREF_BOOLEAN || pref_type == PURPLE_PREF_INT) && + pref_value == NULL) { + /* Missing a value attribute */ + return; + } + if(purple_strequal(element_name, "item")) { struct purple_pref *pref;