aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook
diff options
context:
space:
mode:
authorJason Leach <jleach@ximian.com>2001-07-12 20:27:49 +0800
committerJacob Leach <jleach@src.gnome.org>2001-07-12 20:27:49 +0800
commit6b3232a68491b65eb0185c443b7bdd1d7864253d (patch)
tree05561c5f65cde617dd3806674d7b4d2870cf79de /addressbook/backend/ebook
parentb1ad8e5b13334b4104ac4814ea8d8dd093f4866b (diff)
downloadgsoc2013-evolution-6b3232a68491b65eb0185c443b7bdd1d7864253d.tar
gsoc2013-evolution-6b3232a68491b65eb0185c443b7bdd1d7864253d.tar.gz
gsoc2013-evolution-6b3232a68491b65eb0185c443b7bdd1d7864253d.tar.bz2
gsoc2013-evolution-6b3232a68491b65eb0185c443b7bdd1d7864253d.tar.lz
gsoc2013-evolution-6b3232a68491b65eb0185c443b7bdd1d7864253d.tar.xz
gsoc2013-evolution-6b3232a68491b65eb0185c443b7bdd1d7864253d.tar.zst
gsoc2013-evolution-6b3232a68491b65eb0185c443b7bdd1d7864253d.zip
Crash fix because strcmp() hates NULL arguments. Bug #3777.
2001-07-12 Jason Leach <jleach@ximian.com> * backend/ebook/evolution-vcard-importer.c (support_format_fn): Crash fix because strcmp() hates NULL arguments. Bug #3777. svn path=/trunk/; revision=11034
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r--addressbook/backend/ebook/evolution-vcard-importer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/addressbook/backend/ebook/evolution-vcard-importer.c b/addressbook/backend/ebook/evolution-vcard-importer.c
index 2864627a39..7a3a56fbd6 100644
--- a/addressbook/backend/ebook/evolution-vcard-importer.c
+++ b/addressbook/backend/ebook/evolution-vcard-importer.c
@@ -113,7 +113,9 @@ process_item_fn (EvolutionImporter *importer,
}
static char *supported_extensions[3] = {
- ".vcf", ".gcrd", NULL
+ ".vcf",
+ ".gcrd",
+ NULL
};
/* Actually check the contents of this file */
@@ -154,6 +156,12 @@ support_format_fn (EvolutionImporter *importer,
int i;
ext = strrchr (filename, '.');
+
+ /* Require an extension in order to strcmp with our list of
+ supported extensions */
+ if (ext == NULL)
+ return FALSE;
+
for (i = 0; supported_extensions[i] != NULL; i++) {
if (strcmp (supported_extensions[i], ext) == 0)
return check_file_is_vcard (filename);