projects
/
modest
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e08b1db
)
Fixes NB#132711, junk characters added to filenames with non-ASCII attachment names
author
Sergio Villar Senin
<svillar@igalia.com>
Tue, 29 Sep 2009 16:15:55 +0000
(18:15 +0200)
committer
Sergio Villar Senin
<svillar@igalia.com>
Tue, 13 Oct 2009 14:17:55 +0000
(16:17 +0200)
src/modest-utils.c
patch
|
blob
|
history
diff --git
a/src/modest-utils.c
b/src/modest-utils.c
index
8df81af
..
358228c
100644
(file)
--- a/
src/modest-utils.c
+++ b/
src/modest-utils.c
@@
-128,23
+128,19
@@
modest_utils_create_temp_stream (const gchar *orig_name, const gchar *hash_base,
{
gint fd;
gchar *filepath = NULL;
{
gint fd;
gchar *filepath = NULL;
- gchar *tmpdir, *tmp;
+ gchar *tmpdir;
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);
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);
- tmp = g_uri_escape_string (orig_name, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT, FALSE);
-
- if (strlen(tmp) > 200) {
- g_free (tmp);
+ if (strlen(orig_name) > 200) {
g_warning ("%s: filename too long ('%s')",
__FUNCTION__, orig_name);
return NULL;
}
g_warning ("%s: filename too long ('%s')",
__FUNCTION__, orig_name);
return NULL;
}
- if (g_strstr_len (tmp, strlen (tmp), "/") != NULL) {
- g_free (tmp);
+ if (g_strstr_len (orig_name, strlen (orig_name), "/") != NULL) {
g_warning ("%s: filename contains '/' character(s) (%s)",
__FUNCTION__, orig_name);
return NULL;
g_warning ("%s: filename contains '/' character(s) (%s)",
__FUNCTION__, orig_name);
return NULL;
@@
-164,8
+160,7
@@
modest_utils_create_temp_stream (const gchar *orig_name, const gchar *hash_base,
return NULL;
}
return NULL;
}
- filepath = g_build_filename (tmpdir, tmp, NULL);
- g_free (tmp);
+ filepath = g_build_filename (tmpdir, orig_name, NULL);
/* if file exists, first we try to remove it */
if (g_access (filepath, F_OK) == 0)
/* if file exists, first we try to remove it */
if (g_access (filepath, F_OK) == 0)