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

Closed
tigerfoot opened this Issue Jun 1, 2012 · 2 comments

Comments

Projects
None yet
3 participants
@tigerfoot
Contributor

tigerfoot commented Jun 1, 2012

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()                  */

@ghost ghost assigned aboudreault Jun 4, 2012

@dmorissette

This comment has been minimized.

Show comment
Hide comment
@dmorissette

dmorissette Jun 4, 2012

Contributor

Alan, can you please take care of this?

Contributor

dmorissette commented Jun 4, 2012

Alan, can you please take care of this?

@aboudreault

This comment has been minimized.

Show comment
Hide comment
@aboudreault

aboudreault Jun 15, 2012

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.

Member

aboudreault commented Jun 15, 2012

@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