Mailing List Archive

Re: svn commit: r1874011 - /httpd/httpd/trunk/server/mpm/event/event.c
Hi,

The same code exists in 'worker', should it be fixed as well?

CJ

Le 14/02/2020 à 11:47, jorton@apache.org a écrit :
> Author: jorton
> Date: Fri Feb 14 10:47:36 2020
> New Revision: 1874011
>
> URL: http://svn.apache.org/viewvc?rev=1874011&view=rev
> Log:
> * server/mpm/event/event.c (event_open_logs): Avoid UBSan exception
> calling memcpy(,NULL,0) at startup. Thanks to rpluem.
>
> Modified:
> httpd/httpd/trunk/server/mpm/event/event.c
>
> Modified: httpd/httpd/trunk/server/mpm/event/event.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1874011&r1=1874010&r2=1874011&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/mpm/event/event.c (original)
> +++ httpd/httpd/trunk/server/mpm/event/event.c Fri Feb 14 10:47:36 2020
> @@ -3616,8 +3616,9 @@ static int event_open_logs(apr_pool_t *
> new_max = num_buckets;
> }
> new_ptr = (int *)apr_palloc(ap_pglobal, new_max * sizeof(int));
> - memcpy(new_ptr, retained->idle_spawn_rate,
> - retained->mpm->num_buckets * sizeof(int));
> + if (retained->idle_spawn_rate) /* NULL at startup */
> + memcpy(new_ptr, retained->idle_spawn_rate,
> + retained->mpm->num_buckets * sizeof(int));
> retained->idle_spawn_rate = new_ptr;
> retained->mpm->max_buckets = new_max;
> }
>
>
Re: svn commit: r1874011 - /httpd/httpd/trunk/server/mpm/event/event.c [ In reply to ]
On 02/14/2020 05:17 PM, Marion & Christophe JAILLET wrote:
> Hi,
>
> The same code exists in 'worker', should it be fixed as well?

I would think so.

Regards

Rüdiger