﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
2499	ngx_array_init/ngx_palloc strange behavior on zero size	gertitomir@…		"ngx_array_init populates a valid elts pointer when n is zero. If you initialize several different arrays and specify the parameter n = 0, then all elts arrays will contain the same address. This is because inside ngx_array_init the ngx_palloc function returns a valid pointer when the allocation size is zero. It seems to me that this is incorrect behavior.

So first, there is a problem with ngx_palloc. Secondly, we need to add a check for the n parameter in the ngx_array_init function so that it considers n = 1 even if it is zero."	defect	closed	minor		documentation	1.19.x	invalid	pool, ngx_palloc, ngx_array_init		Linux andersen-pc 5.10.0-22-amd64 #1 SMP Debian 5.10.178-3 (2023-04-22) x86_64 GNU/Linux	"nginx version: nginx/1.22.1
built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 
configure arguments: --add-dynamic-module=/home/*****-module --prefix=/home/******-module/test/debug --conf-path=/home/andersen/work/nginx-swaf-module/test/test.conf --error-log-path=/dev/stdout --with-debug --with-cc-opt='-O0 -g'
"
