Skip to content

Loading…

mapogr.cpp msOGREscapePropertyName & msOGREscapeSQLParam could return random data #4335

Closed
tigerfoot opened this Issue · 2 comments

3 participants

@tigerfoot

msOGREscapePropertyName
msOGREscapeSQLParam

Due to a misplaced #endif & RETURN NULL the two function could return random data.

The following patch fix that ( patch made against 6.0.3 stock tar.gz )

--- mapogr.cpp.origin   2012-06-01 14:25:23.524588844 +0200
+++ mapogr.cpp  2012-06-01 14:27:23.302583807 +0200
@@ -3719,9 +3719,8 @@
 
   msSetError(MS_MISCERR, "OGR support is not available.", 
              "msOGREscapeSQLParam()");
-  return NULL;
-
 #endif /* USE_OGR */  
+  return NULL;
 }
 
 
@@ -3753,9 +3752,8 @@
 
   msSetError(MS_MISCERR, "OGR support is not available.", 
              "msOGREscapePropertyName()");
-  return NULL;
-
 #endif /* USE_OGR */  
+  return NULL;
 }
 /************************************************************************/
 /*                  msOGRLayerInitializeVirtualTable()                  */
@aboudreault aboudreault was assigned
@dmorissette

Alan, can you please take care of this?

@aboudreault aboudreault pushed a commit that referenced this issue
Alan Boudreault Fix msOGREscapeSQLParam could return random data (#4335) f51753f
@aboudreault
MapServer member

@tigerfoot , thanks for the patch. You'll notice a small difference with the patch I've committed and your, I've simply taken the mapserver master trunk (which had already the patch) for consistence. Both was good. However, I haven't modified the function msOGREscapePropertyName, since it was already ok. Let me know If I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.