Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] perl module: fix SSI parameter termination bug

Matthew Daley
March 13, 2012 08:36PM
On Wed, Mar 14, 2012 at 3:16 AM, Alexandr Gomoliako <zzz@zzz.org.ua> wrote:
[...]
>
>>> Correct solution would be to reserve space for NUL character in
>>> ssi module instead.  Quick and dirty patch which should work:
>
>>> --- a/src/http/modules/ngx_http_ssi_filter_module.c
>>> +++ b/src/http/modules/ngx_http_ssi_filter_module.c
>>> @@ -1204,7 +1204,7 @@ ngx_http_ssi_parse(ngx_http_request_t *r
>>>
>>>                 if (ctx->value_buf == NULL) {
>>>                     ctx->param->value.data = ngx_pnalloc(r->pool,
>>> -                                                         ctx->value_len);
>>> +                                                         ctx->value_len +
>>> 1);
>>>                     if (ctx->param->value.data == NULL) {
>>>                         return NGX_ERROR;
>>>                     }
>>>
>>
>> I wasn't sure if changing the SSI allocation code was appropriate in
>> this case, but since newSVpvn really does need the NULL termination,
>> this is indeed a better idea.
>
> No, it's not. The only solution is to fix it in ssi module, as
> proposed by Maxim.
>

I think you misunderstood me there; I was indeed agreeing that
applying the fix in the SSI module is a better idea, not my original
patch.

Thanks for the info on newSVpvn.

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] perl module: fix SSI parameter termination bug Attachments

Matthew Daley 1283 March 13, 2012 03:36AM

Re: [PATCH] perl module: fix SSI parameter termination bug

Maxim Dounin 467 March 13, 2012 04:30AM

Re: [PATCH] perl module: fix SSI parameter termination bug

Matthew Daley 462 March 13, 2012 04:44AM

Re: [PATCH] perl module: fix SSI parameter termination bug

Alexandr Gomoliako 404 March 13, 2012 10:18AM

Re: [PATCH] perl module: fix SSI parameter termination bug

Alexandr Gomoliako 463 March 13, 2012 10:30AM

Re: [PATCH] perl module: fix SSI parameter termination bug

Matthew Daley 516 March 13, 2012 08:36PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready