* src/plugins/pgpinline/pgpinline.c
Fix bug 1779, 'PGP Inline badly handles
multipart'. Properly dump the current part
instead of running around with scissors
+2008-12-01 [colin] 3.6.1cvs56
+
+ * src/plugins/pgpinline/pgpinline.c
+ Fix bug 1779, 'PGP Inline badly handles
+ multipart'. Properly dump the current part
+ instead of running around with scissors
+
2008-11-30 [paul] 3.6.1cvs55
* manual/advanced.xml
2008-11-30 [paul] 3.6.1cvs55
* manual/advanced.xml
( cvs diff -u -r 1.8.2.52 -r 1.8.2.53 README; cvs diff -u -r 1.1.2.51 -r 1.1.2.52 manual/advanced.xml; ) > 3.6.1cvs53.patchset
( cvs diff -u -r 1.1.2.34 -r 1.1.2.35 src/prefs_other.c; cvs diff -u -r 1.12.2.48 -r 1.12.2.49 src/gtk/prefswindow.c; ) > 3.6.1cvs54.patchset
( cvs diff -u -r 1.1.2.52 -r 1.1.2.53 manual/advanced.xml; cvs diff -u -r 1.1.2.22 -r 1.1.2.23 manual/plugins.xml; cvs diff -u -r 1.30.2.53 -r 1.30.2.54 src/prefs_toolbar.c; ) > 3.6.1cvs55.patchset
( cvs diff -u -r 1.8.2.52 -r 1.8.2.53 README; cvs diff -u -r 1.1.2.51 -r 1.1.2.52 manual/advanced.xml; ) > 3.6.1cvs53.patchset
( cvs diff -u -r 1.1.2.34 -r 1.1.2.35 src/prefs_other.c; cvs diff -u -r 1.12.2.48 -r 1.12.2.49 src/gtk/prefswindow.c; ) > 3.6.1cvs54.patchset
( cvs diff -u -r 1.1.2.52 -r 1.1.2.53 manual/advanced.xml; cvs diff -u -r 1.1.2.22 -r 1.1.2.23 manual/plugins.xml; cvs diff -u -r 1.30.2.53 -r 1.30.2.54 src/prefs_toolbar.c; ) > 3.6.1cvs55.patchset
+( cvs diff -u -r 1.1.2.39 -r 1.1.2.40 src/plugins/pgpinline/pgpinline.c; ) > 3.6.1cvs56.patchset
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
static gchar *get_part_as_string(MimeInfo *mimeinfo)
{
gchar *textdata = NULL;
static gchar *get_part_as_string(MimeInfo *mimeinfo)
{
gchar *textdata = NULL;
- gchar *real_data = NULL;
+ gchar *filename = NULL;
+ FILE *fp;
+
g_return_val_if_fail(mimeinfo != NULL, 0);
procmime_decode_content(mimeinfo);
g_return_val_if_fail(mimeinfo != NULL, 0);
procmime_decode_content(mimeinfo);
if (mimeinfo->content == MIMECONTENT_MEM)
textdata = g_strdup(mimeinfo->data.mem);
else {
if (mimeinfo->content == MIMECONTENT_MEM)
textdata = g_strdup(mimeinfo->data.mem);
else {
- /* equals file_read_to_str but without conversion */
- FILE *fp = fopen(mimeinfo->data.filename, "r");
- if (!fp)
+ filename = procmime_get_tmp_file_name(mimeinfo);
+ if (procmime_get_part(filename, mimeinfo) < 0) {
+ printf("error dumping file\n");
+ return NULL;
+ }
+ fp = fopen(filename,"rb");
+ if (!fp) {
+ printf("error reading file\n");
textdata = fp_read_noconv(fp);
fclose(fp);
textdata = fp_read_noconv(fp);
fclose(fp);
+ g_unlink(filename);
+ g_free(filename);
}
if (!g_utf8_validate(textdata, -1, NULL)) {
}
if (!g_utf8_validate(textdata, -1, NULL)) {
- if (textdata && mimeinfo->offset &&
- mimeinfo->offset+ mimeinfo->length <= g_utf8_strlen(textdata, -1)) {
- real_data = g_strdup(textdata + mimeinfo->offset);
- g_free(textdata);
- textdata = real_data;
- } else if (textdata && mimeinfo->offset &&
- mimeinfo->offset+ mimeinfo->length <= strlen(textdata)) {
- real_data = g_strdup(textdata + mimeinfo->offset);
- real_data[mimeinfo->length] = '\0';
- g_free(textdata);
- textdata = real_data;
- } else if (textdata && mimeinfo->offset) {
- debug_print("got data shorter than what it should be\n");
- }