aboutsummaryrefslogtreecommitdiff
path: root/src/procmime.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-03-04 07:05:52 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-03-04 07:05:52 +0000
commitbdcba0877a6b870e40dcca384ef08be78fd0e74e (patch)
treec65bebfd067e3aaea7f9614443670b3ddee0b543 /src/procmime.c
parenta80cf7559e18da4e89fae15c2ff10966b1983ffa (diff)
fixed a buffer overflow bug.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@145 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/procmime.c')
-rw-r--r--src/procmime.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/procmime.c b/src/procmime.c
index 39e5fde9..2a527774 100644
--- a/src/procmime.c
+++ b/src/procmime.c
@@ -403,15 +403,9 @@ void procmime_scan_content_type_str(const gchar *content_type,
if (*value) {
if (charset && !g_strcasecmp(attr, "charset"))
*charset = g_strdup(value);
- else if (name && !g_strcasecmp(attr, "name")) {
- gchar *tmp;
- size_t len;
-
- len = strlen(value) + 1;
- Xalloca(tmp, len, return);
- conv_unmime_header(tmp, len, value, NULL);
- *name = g_strdup(tmp);
- } else if (boundary && !g_strcasecmp(attr, "boundary"))
+ else if (name && !g_strcasecmp(attr, "name"))
+ *name = conv_unmime_header(value, NULL);
+ else if (boundary && !g_strcasecmp(attr, "boundary"))
*boundary = g_strdup(value);
}
@@ -457,14 +451,9 @@ void procmime_scan_content_disposition(MimeInfo *mimeinfo,
if (*value) {
if (!strcasecmp(attr, "filename")) {
- gchar *tmp;
- size_t len;
-
- len = strlen(value) + 1;
- Xalloca(tmp, len, return);
- conv_unmime_header(tmp, len, value, NULL);
g_free(mimeinfo->filename);
- mimeinfo->filename = g_strdup(tmp);
+ mimeinfo->filename =
+ conv_unmime_header(value, NULL);
break;
}
}