# HG changeset patch # User Paul Aurich # Date 1311218211 0 # Node ID 6da9e43e17d82992f2b9d4935ad554b2f6a141cc # Parent cb4705abb991389f05a5d88349b402f8ee08a867 prefs: Avoid an atoi(NULL) when reading the prefs from disk Clang identified that no value attribute lead to an unconditional NULL deref here diff -r cb4705abb991 -r 6da9e43e17d8 libpurple/prefs.c --- 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;