Ticket #220 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

Potential problem with recursive calls to msBuildPath()

Reported by: dmorissette Owned by: jlacroix
Priority: high Milestone:
Component: MapServer C Library Version: 4.0
Severity: normal Keywords:
Cc:

Description

There are a few places (at least in mapraster.c) where we find recursive 
msBuildPath() calls using the same temporary buffer, i.e.
  msBuildPath(szPath, msBuildPath(szPath, .., ...), filename);

This can result in unpredictable behaviors on some platforms since the function 
contains a sprintf() call that would end up reading from and writing to the same 
string buffer.

I suggest that we create a new msBuildPath3() that takes 3 path components (2 
paths and a filename) and combines them and then replace all occurences of 
recursive calls in MapServer with this new function.

Julien, please talk to me when you're ready to implement this.

Change History

Changed 11 years ago by jlacroix

  • status changed from new to closed
  • resolution set to fixed
I added a msBuildPath3 function that takes 3 path parameters.

So its fixed!
Note: See TracTickets for help on using tickets.