Hi Mohamed,

> Append all multiple message-header fields with the same name and
> remove any white space in front of fiels value.
> ---
>  gweb/gweb.c |  119 
> +++++++++++++++++++++++++++++++++++++++--------------------
>  1 files changed, 79 insertions(+), 40 deletions(-)

I applied this patch, however ...

<snip>

> +     pos = memchr(str, ':', session->current_header->len);
> +     if (pos != NULL) {
> +             *pos = '\0';
> +             pos++;
> +
> +             key = g_strdup(str);
> +
> +             /* remove white space */
> +             while (*pos == ' ')
> +                     pos++;
> +

... so I fixed the comment for your. Since it removes multiple preceding
white spaces and not just one.

Also this is not really safe what you are doing here. You need to check
the length of the value field. So that you not accidentally overrun.

And you need to handle headers where the server might just give you only
spaces. Please be pretty much paranoid here. You can not trust anything
that comes in from the server. It could be malicious.

> +             count = (char *)pos - str;

We use an extra space after a cast. I fixed that one up for you as well.

Regards

Marcel


_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to