[mapserver-dev] Ticket 3537 - Buffer overflow vulnerabilities

Yewondwossen Assefa yassefa at dmsolutions.ca
Wed Oct 6 15:12:55 EDT 2010


  On 06/10/2010 3:01 PM, Yewondwossen Assefa wrote:
>  On 06/10/2010 2:21 PM, Daniel Morissette wrote:
>> 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 tried const and static const but both did not work. For some reason 
> the variable is not seen as being constant at compile time. I have to 
> use the value 512 for it to compile, I will look if there are other ways.
>
I actually need to use a #define with MSVC 2005 and above 
(http://msdn.microsoft.com/en-us/library/eff825eh%28v=VS.90%29.aspx)
Adding a const would have worked with 2003 version.



-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: yassefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------




More information about the mapserver-dev mailing list