Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tigerfoot opened this issue Jun 1, 2012 · 2 comments
Assignees
Milestone

Comments

@tigerfoot
Copy link
Contributor

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
Copy link
Contributor

Alan, can you please take care of this?

@aboudreault
Copy link
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
Projects
None yet
Development

No branches or pull requests

3 participants