httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: cvs commit: httpd-apreq-2/env/t/cgi-bin .cvsignore
Date Fri, 24 Oct 2003 20:05:45 GMT
Joe Schaefer wrote:
> Stas Bekman <> writes:
>>Joe Schaefer wrote:
>>>... I had some problems running the
>>>tests with apr's current cvs- apr_env_get's behavior may have changed
>>>slightly, and I was getting segfaults on cgi tests 1-9. Initializing
>>>value = NULL took care of those.
>>What was the exact problem? 
> Segfaults on RH8, because apreq_env_header_in returns an uninitialized
> value whenever apr_env_get failed.  On a lucky platform, that
> unitialized value was zero, which is fine.  On my (unlucky) platform, 
> the returned value was 1.
>>As long as you check for APR_SUCCESS the value should be OK to you
>>without initializing it. I think the workaround of initting it to NULL
>>hides the real problem. 
> It's just fine so long as apr_env_get only mangles its first argument
> on APR_SUCCESS.  apreq_env_header_in() must return NULL when apr_env_get
> fails; initializing value = NULL ensures that will happen.

what's the definition of 'failed'? There is no env var, or it has failed to 
get it (not implemented, etc)?

>>I did suggested to use a macro APREQ_ENV_STATUS to make the testing
> I'm not a fan of that particular macro.

I just hate when those error checks clutter the code. As for APREQ_ENV_STATUS, 
I just suggested it as an idea, at the moment it's broken, as it lets the 
failures through (only warns).

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message