Mercurial > pidgin.yaz
comparison libpurple/prefs.c @ 32209: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 |
comparison
equal
deleted
inserted
replaced
32208:cb4705abb991 | 32209:6da9e43e17d8 |
---|---|
273 else | 273 else |
274 return; | 274 return; |
275 } else if(purple_strequal(attribute_names[i], "value")) { | 275 } else if(purple_strequal(attribute_names[i], "value")) { |
276 pref_value = attribute_values[i]; | 276 pref_value = attribute_values[i]; |
277 } | 277 } |
278 } | |
279 | |
280 if ((pref_type == PURPLE_PREF_BOOLEAN || pref_type == PURPLE_PREF_INT) && | |
281 pref_value == NULL) { | |
282 /* Missing a value attribute */ | |
283 return; | |
278 } | 284 } |
279 | 285 |
280 if(purple_strequal(element_name, "item")) { | 286 if(purple_strequal(element_name, "item")) { |
281 struct purple_pref *pref; | 287 struct purple_pref *pref; |
282 | 288 |