httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "PKU-bswen" <bs...@pku.edu.cn>
Subject A possible bug found // RE: svn commit: r783 - /release/httpd/
Date Tue, 21 Aug 2012 12:00:15 GMT
A possible subtle bug with httpd-2.4.3 on Windows (Server 2008 R2) was found

in the following source file, which was compiled using VS2010:

httpd-2.4.3/server/config.c

// line 602:
        ap_module_short_names[m->module_index] = strdup(sym_name);

// line 680:
        free(ap_module_short_names[m->module_index]);

The bug was associated with the (new) implementation of the strdup()
function: 
it calls malloc() when compiled as non-debug version, but calls
_malloc_dbg() when 
compiled for debugging. In the later case, the free() at line 680 call would
always fail 
and cause the process terminated.

The following was my quick fixing of the problem, which uses _free_dbg() to
free 
the strings memory space:

#ifdef WIN32
#ifdef _DEBUG
        _free_dbg(ap_module_short_names[m->module_index],
1/*_NORMAL_BLOCK*/); 
#else  /* _DEBUG */
        free(ap_module_short_names[m->module_index]);
#endif  /* _DEBUG */
#else
        free(ap_module_short_names[m->module_index]);
#endif  /* WIN32 */

This solution was not a clean one, though (server/config.c is on an OS
independent level). 
So please verify the issue.

Regrards,
Bing



-----Original Message-----
From: Jeff Trawick [mailto:trawick@gmail.com]
Sent: Tuesday, August 21, 2012 7:54 AM
To: dev@httpd.apache.org
Subject: Re: svn commit: r783 - /release/httpd/

On Mon, Aug 20, 2012 at 1:45 PM,  <jim@apache.org> wrote:
> Author: jim
> Date: Mon Aug 20 17:45:46 2012
> New Revision: 783
>
> Log:
> Scrap old

Uhh, once the next is on all the mirrors and the page is updated to point to
2.4.3 ;)

>
> Removed:
>     release/httpd/CHANGES_2.4.2
>     release/httpd/httpd-2.4.2-deps.tar.bz2
>     release/httpd/httpd-2.4.2-deps.tar.bz2.asc
>     release/httpd/httpd-2.4.2-deps.tar.bz2.md5
>     release/httpd/httpd-2.4.2-deps.tar.bz2.sha1
>     release/httpd/httpd-2.4.2-deps.tar.gz
>     release/httpd/httpd-2.4.2-deps.tar.gz.asc
>     release/httpd/httpd-2.4.2-deps.tar.gz.md5
>     release/httpd/httpd-2.4.2-deps.tar.gz.sha1
>     release/httpd/httpd-2.4.2.tar.bz2
>     release/httpd/httpd-2.4.2.tar.bz2.asc
>     release/httpd/httpd-2.4.2.tar.bz2.md5
>     release/httpd/httpd-2.4.2.tar.bz2.sha1
>     release/httpd/httpd-2.4.2.tar.gz
>     release/httpd/httpd-2.4.2.tar.gz.asc
>     release/httpd/httpd-2.4.2.tar.gz.md5
>     release/httpd/httpd-2.4.2.tar.gz.sha1
>



Mime
View raw message