[mapserver-dev] Ticket 3537 - Buffer overflow vulnerabilities

Daniel Morissette dmorissette at mapgears.com
Wed Oct 6 14:21:12 EDT 2010

Yewondwossen Assefa wrote:
> Building with MSVC (9), I get build errors for the following declaration:
> size_t buffer_size = 512;
>  char buffer[buffer_size];  #line 2209
> mappostgis.c(2209) : error C2057: expected constant expression
> mappostgis.c(2209) : error C2466: cannot allocate an array of constant
> size 0
> mappostgis.c(2209) : error C2133: 'buffer' : unknown size
>  I will change locally and continue the build.

What change did you make? Was it enough to make buffer_size a const?

> I also get build errors usually when variables are declared in the
> middle of the code and not at the beginning of functions or beginning of
> loops. I am not sure if it is a setting that I need to do or It is is
> simply not valid for all compilers. I tend to correct that when I build
> on windows.

I agree that in those cases moving the declarations to the beginning of
the code block is the way to go.

> Except the 2 issues I mentioned, It build ok for me. 

Thanks for testing

Daniel Morissette

More information about the mapserver-dev mailing list