[Commits] [SCM] claws branch, master, updated. 3.13.2-157-g18292e3
Andrej Kacian
andrej at kacian.sk
Mon Jun 27 17:09:21 CEST 2016
On Mon, 27 Jun 2016 16:37:34 +0200 (CEST)
charles at claws-mail.org wrote:
> - Log -----------------------------------------------------------------
> commit 18292e3bbdb1c1cf3da8ad4c4a0edaa4f9c048c7
> Author: Charles Lehner <charles at claws-mail.org>
> Date: Mon Jun 27 10:28:41 2016 -0400
>
> Handle ical lines longer than 256 bytes
>
> diff --git a/src/plugins/vcalendar/vcal_manager.c b/src/plugins/vcalendar/vcal_manager.c
> index 1f11f26..9c9c856 100644
> --- a/src/plugins/vcalendar/vcal_manager.c
> +++ b/src/plugins/vcalendar/vcal_manager.c
> @@ -729,9 +729,9 @@ gchar *vcal_manager_icalevent_dump(icalcomponent *event, gchar *orga, icalcompon
>
> /* encode to quoted-printable */
> while (lines[i]) {
> - gchar buf[256];
> gint e_len = strlen(qpbody), n_len = 0;
> gchar *outline = conv_codeset_strdup(lines[i], CS_UTF_8, conv_get_outgoing_charset_str());
> + gchar buf[strlen(outline)*8];
>
> qp_encode_line(buf, (guchar *)outline);
> n_len = strlen(buf);
If we're dealing with unknown buffer size, wouldn't it be safer to
allocate it on the heap, to prevent potential stack overflow?
Regards,
--
Andrej
More information about the Commits
mailing list