[PATCH] Fix process_body_receive handle of contents without final newlines

0 views
Skip to first unread message

Simone Contini

unread,
Dec 13, 2009, 4:01:37 AM12/13/09
to msn-...@googlegroups.com, Simone Contini
---
pn_oim.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pn_oim.c b/pn_oim.c
index 6faaabe..ae1b7dd 100644
--- a/pn_oim.c
+++ b/pn_oim.c
@@ -576,7 +576,8 @@ process_body_receive (OimRequest *oim_request,
gchar *end;
cur += 2;
end = strstr (cur, "\r\n\r\n");
- *end = '\0';
+ if (end)
+ *end = '\0';
message = (gchar *) purple_base64_decode (cur, NULL);
}

--
1.6.5.2

Felipe Contreras

unread,
Dec 13, 2009, 6:33:55 AM12/13/09
to Simone Contini, msn-...@googlegroups.com
On Sun, Dec 13, 2009 at 11:01 AM, Simone Contini
<s.co...@oltrelinux.com> wrote:
> ---

The subject of the message is too long, I changed it to:
oim: handle malformed data in process_body_receive

>  pn_oim.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/pn_oim.c b/pn_oim.c
> index 6faaabe..ae1b7dd 100644
> --- a/pn_oim.c
> +++ b/pn_oim.c
> @@ -576,7 +576,8 @@ process_body_receive (OimRequest *oim_request,
>         gchar *end;
>         cur += 2;
>         end = strstr (cur, "\r\n\r\n");
> -        *end = '\0';
> +               if (end)

This line is not properly aligned.

> +            *end = '\0';
>         message = (gchar *) purple_base64_decode (cur, NULL);
>     }
>
> --

In any case. I made the changes and committed the fix. Thanks!

http://github.com/felipec/msn-pecan/commit/e0fa9a5bcc356ad20c359cf208bbc84f155cdb71

--
Felipe Contreras

Simone

unread,
Dec 13, 2009, 6:55:25 AM12/13/09
to msn-pecan


On 13 Dic, 12:33, Felipe Contreras <felipe.contre...@gmail.com> wrote:

> The subject of the message is too long, I changed it to:
> oim: handle malformed data in process_body_receive

ok, I'll do it by myself next time!

> >         end = strstr (cur, "\r\n\r\n");
> > -        *end = '\0';
> > +               if (end)
>
> This line is not properly aligned.

yes, sorry, it was aligned in my editor, I have some problem with
spaces/tabs ;)

> In any case. I made the changes and committed the fix. Thanks!

Thank you!

--
Simone Contini

Reply all
Reply to author
Forward
0 new messages