[folks] Check FieldDetails values before storing to avoid segfaults.
- From: Travis Reitter <treitter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] Check FieldDetails values before storing to avoid segfaults.
- Date: Thu, 3 Mar 2011 19:18:42 +0000 (UTC)
commit a69d0fcecc75040aae0276723db99375f58bebbf
Author: Travis Reitter <travis reitter collabora co uk>
Date: Thu Mar 3 09:47:22 2011 -0800
Check FieldDetails values before storing to avoid segfaults.
This protects against backends storing some bogus data in their Personas (in
this case, value-less URL, Phone Number, or Email Address fields).
folks/individual.vala | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/folks/individual.vala b/folks/individual.vala
index e2e5bca..cbbb15f 100644
--- a/folks/individual.vala
+++ b/folks/individual.vala
@@ -1044,6 +1044,9 @@ public class Folks.Individual : Object,
{
foreach (unowned FieldDetails ps in urlable.urls)
{
+ if (ps.value == null)
+ continue;
+
var existing = urls_set.lookup (ps.value);
if (existing != null)
existing.extend_parameters (ps.parameters);
@@ -1080,6 +1083,9 @@ public class Folks.Individual : Object,
{
foreach (unowned FieldDetails fd in phoneable.phone_numbers)
{
+ if (fd.value == null)
+ continue;
+
var existing = phone_numbers_set.lookup (fd.value);
if (existing != null)
existing.extend_parameters (fd.parameters);
@@ -1106,6 +1112,9 @@ public class Folks.Individual : Object,
{
foreach (unowned FieldDetails fd in emailable.email_addresses)
{
+ if (fd.value == null)
+ continue;
+
var existing = emails_set.lookup (fd.value);
if (existing != null)
existing.extend_parameters (fd.parameters);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]