summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2017-12-24 21:54:31 -0700
committerEduardo Chappa <chappa@washington.edu>2017-12-24 21:54:31 -0700
commit965befd7936f8a788b950d650b76f34f606fc1e1 (patch)
tree30b67a65af9555c00e586842b1ed4e9c8e5a0579 /pith
parent5cb80f3539fd43b785638b676c7ba242bda2f75d (diff)
downloadalpine-965befd7936f8a788b950d650b76f34f606fc1e1.tar.xz
* A few fixes to ical.c and mailview.c to avoid memory leaks, and
add support for encodings other than quoted-printable and base64.
Diffstat (limited to 'pith')
-rw-r--r--pith/ical.c5
-rw-r--r--pith/mailview.c11
-rw-r--r--pith/pine.hlp2
3 files changed, 13 insertions, 5 deletions
diff --git a/pith/ical.c b/pith/ical.c
index 75212514..64731a96 100644
--- a/pith/ical.c
+++ b/pith/ical.c
@@ -239,7 +239,10 @@ ical_decode(char *text, unsigned short encoding)
unsigned long callen;
if(encoding == ENCQUOTEDPRINTABLE){
t = rfc822_qprint ((unsigned char *) text,strlen(text),&callen);
- strncpy(text, t, strlen(t));
+ if(t != NULL){
+ strncpy(text, t, strlen(t));
+ fs_give((void **) &t);
+ }
}
return text;
}
diff --git a/pith/mailview.c b/pith/mailview.c
index 984b560f..1d92bd91 100644
--- a/pith/mailview.c
+++ b/pith/mailview.c
@@ -515,10 +515,15 @@ format_calendar(long int msgno, BODY *body, HANDLE_S **handlesp, int flgs, int w
continue;
}
break;
+
+ default: caltext = cpystr(rawtext);
+ }
+ if(caltext != NULL){
+ vcal = ical_parse_text(caltext);
+ if(vcal != NULL) vcal->encoding = b->encoding;
+ b->sparep = create_body_sparep(iCalType, (void *) vcal);
+ fs_give((void **) &caltext);
}
- vcal = ical_parse_text(caltext);
- if(vcal != NULL) vcal->encoding = b->encoding;
- b->sparep = create_body_sparep(iCalType, (void *) vcal);
}
else if(get_body_sparep_type(b->sparep) == iCalType)
vcal = (VCALENDAR_S *) get_body_sparep_data(b->sparep);
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 79cb3c9f..2fa13844 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 244 2017-12-24 19:13:32
+Alpine Commit 245 2017-12-24 21:54:15
============= h_news =================
<HTML>
<HEAD>