Re: gwlib/http.c patch

"Nikos Balkanas" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <001001c9b14b$79a4d940$02b2a8c0@tardis>
By all means! Good eyes. +1

Nikos
----- Original Message ----- 
From: "Vincent CHAVANIS" <[email protected]>
To: <[email protected]>
Sent: Monday, March 30, 2009 5:50 PM
Subject: Re: gwlib/http.c patch



We should in that case also patch *http_header_value()

Vincent.


Alexander Malysh a ΞΉcrit :
> hi,
>
> yes, you are right here. it doesn't crash only due to the octstr_copy
> length adjust.
>
> Patch applied to cvs.
>
> Thanks,
> Alex
>
> Am 27.03.2009 um 18:30 schrieb Nikos Balkanas:
>
>> Hi,
>>
>> A small patch that left as it is should lead to memory corruption. I
>> have not tested the broken code but it seems quite obvious to me.
>> Please vote & decide.
>>
>> BR,
>> Nikos
>> <http.diff>
>



--------------------------------------------------------------------------------


> --- /gateway-cvs/gwlib/http.c   2009-03-30 10:58:32.000000000 +0200
> +++ /gateway/gwlib/http.c       2009-03-30 16:38:47.000000000 +0200
> @@ -2850,7 +2850,7 @@
>             current_name = octstr_copy(os, 0, colon);
>         }
>         if (octstr_case_compare(current_name, name) == 0) {
> -            value = octstr_copy(os, colon + 1, octstr_len(os));
> +            value = octstr_copy(os, colon + 1, octstr_len(os) - colon - 
> 1);
>             octstr_strip_blanks(value);
>             octstr_destroy(current_name);
>             return value;
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.