diff options
author | Jason Leach <jleach@ximian.com> | 2001-07-12 20:27:49 +0800 |
---|---|---|
committer | Jacob Leach <jleach@src.gnome.org> | 2001-07-12 20:27:49 +0800 |
commit | 6b3232a68491b65eb0185c443b7bdd1d7864253d (patch) | |
tree | 05561c5f65cde617dd3806674d7b4d2870cf79de | |
parent | b1ad8e5b13334b4104ac4814ea8d8dd093f4866b (diff) | |
download | gsoc2013-evolution-6b3232a68491b65eb0185c443b7bdd1d7864253d.tar.gz 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
-rw-r--r-- | addressbook/ChangeLog | 5 | ||||
-rw-r--r-- | addressbook/backend/ebook/evolution-vcard-importer.c | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 4d00f11361..e807dad1d8 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,8 @@ +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. + 2001-07-11 Jason Leach <jleach@ximian.com> * gui/component/select-names/e-select-names.c (remove_cb): Added 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); |