httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul J. Reder" <rede...@raleigh.ibm.com>
Subject Re: cvs commit: httpd-2.0/modules/generators mod_status.c
Date Thu, 15 Feb 2001 17:51:32 GMT
Ryan,

rbb@apache.org wrote:
> 
> rbb         01/02/14 16:01:34
> 
>   Modified:    modules/generators mod_status.c
>   Log:
>   Remove some warnings from mod_status.
> 
>   Revision  Changes    Path
>   1.27      +7 -7      httpd-2.0/modules/generators/mod_status.c
> 
>   Index: mod_status.c
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/modules/generators/mod_status.c,v
>   retrieving revision 1.26
>   retrieving revision 1.27
>   diff -u -d -b -w -u -r1.26 -r1.27
>   --- mod_status.c      2001/02/14 03:49:17     1.26
>   +++ mod_status.c      2001/02/15 00:01:32     1.27

This patch causes core dumps on Linux. In particular the %lld change
causes ap_rprintf -> apr_vrprintf -> apr_vsnprintf -> apr_vformatter
%s processing (line 938) to dump core due to bad results from the 
va_arg call (s is non-null garbage, causing strlen to dump).

Setting it back to %ld seems to work fine and doesn't seem to give me
warnings.

To reproduce this, all I have to do is start Apache (configed as
apache.org is) and try to browse server-status -- core dump!

>        if (days)
>   -     ap_rprintf(r, " %ld day%s", days, days == 1 ? "" : "s");
>   +     ap_rprintf(r, " %lld day%s", days, days == 1 ? "" : "s");
>        if (hrs)
>   -     ap_rprintf(r, " %ld hour%s", hrs, hrs == 1 ? "" : "s");
>   +     ap_rprintf(r, " %lld hour%s", hrs, hrs == 1 ? "" : "s");
>        if (mins)
>   -     ap_rprintf(r, " %ld minute%s", mins, mins == 1 ? "" : "s");
>   +     ap_rprintf(r, " %lld minute%s", mins, mins == 1 ? "" : "s");
>        if (secs)
>   -     ap_rprintf(r, " %ld second%s", secs, secs == 1 ? "" : "s");
>   +     ap_rprintf(r, " %lld second%s", secs, secs == 1 ? "" : "s");
>    }-- 
Paul J. Reder
-----------------------------------------------------------
"The strength of the Constitution lies entirely in the determination of each
citizen to defend it.  Only if every single citizen feels duty bound to do
his share in this defense are the constitutional rights secure."
-- Albert Einstein

Mime
View raw message