From: Dirk-Jan C. Binnema Date: Fri, 4 Jan 2008 16:14:09 +0000 (+0000) Subject: * fix precondition, which could cause a crash X-Git-Tag: git_migration_finished~1861 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=89c621790370dcbaddb8ff9b9dd233a7211e8d61 * fix precondition, which could cause a crash pmo-trunk-r3982 --- diff --git a/src/modest-utils.c b/src/modest-utils.c index 2a5981c..f0eb11e 100644 --- a/src/modest-utils.c +++ b/src/modest-utils.c @@ -96,7 +96,8 @@ modest_utils_create_temp_stream (const gchar *orig_name, const gchar *hash_base, guint hash_number; /* hmmm... maybe we need a modest_text_utils_validate_file_name? */ - g_return_val_if_fail (orig_name || strlen(orig_name) == 0, NULL); + g_return_val_if_fail (orig_name && strlen(orig_name) != 0, NULL); + if (strlen(orig_name) > 200) { g_warning ("%s: filename too long ('%s')", __FUNCTION__, orig_name);