pidgin/ljfisher-ssl-client-auth

Parents da742b7e1303
Children d9743aa9882a
prefs: Avoid an atoi(NULL) when reading the prefs from disk

Clang identified that no value attribute lead to an unconditional NULL deref here
--- 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;