Comment 9 for bug 809133

Revision history for this message
Steve Beattie (sbeattie) wrote :

Hi Alan,

I noticed a minor thing while reviewing these patches. The patches add a new compilation warning (example from the 5.0.0-3ubuntu0.3 build):

  mapogr.cpp: In function 'char* msOGREscapeSQLParam(layerObj*, const char*)':
  mapogr.cpp:2406: warning: control reaches end of non-void function

which looks to be a correct warning; if USE_OGR is defined and the if condition in msOGREscapeSQLParam() does not evaluate to true, then nothing is returned (which, if IIRC the gcc calling conventions correctly, means that layer will be sitting in the returned value spot). It seems to me that the "return pszEscapedStr ;" needs to move outside of the if statement. However, I've not verified that a returned NULL value is handled correctly by all the potential callers of msOGREscapeSQLParam().

(The comment header for msOGREscapePropertyName() also mistakenly refers to msOGREscapeSQLParam. Note that it does not suffer from the same lack of return value because the "return pszEscapedStr;" is placed correctly.)

It seems the patches that were attached were not the latest ones, as they're missing the PostGIS fixes mentioned in http://trac.osgeo.org/mapserver/ticket/3903 (also, the upstream final versions attached to that bug are all in reverse patch format).

I'll fix up the patches you provided and push them out. Thanks!