aboutsummaryrefslogtreecommitdiff
path: root/src/param.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-12-04 10:56:31 +0100
committerGitHub <noreply@github.com>2021-12-04 10:56:31 +0100
commitd76024b781361cc7b024e0bd240880cfaf1d091f (patch)
tree922f59feb43ec89e9f9c291e48011b2df738afb8 /src/param.cpp
parentc77512d5935be3dce6868f592552f70d7896b193 (diff)
parent45965f2ac677b8d70ee4fcd75545411597cfb3f3 (diff)
downloadPROJ-d76024b781361cc7b024e0bd240880cfaf1d091f.tar.gz
PROJ-d76024b781361cc7b024e0bd240880cfaf1d091f.zip
Merge pull request #2968 from rouault/fix_ossfuzz_41462
Fix extremely long parsing time on hostile PROJ strings
Diffstat (limited to 'src/param.cpp')
-rw-r--r--src/param.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/param.cpp b/src/param.cpp
index 21afc57f..0a9a66d8 100644
--- a/src/param.cpp
+++ b/src/param.cpp
@@ -9,31 +9,6 @@
#include "proj.h"
#include "proj_internal.h"
-static void unquote_string(char* param_str) {
-
- size_t len = strlen(param_str);
- // Remove leading and terminating spaces after equal sign
- const char* equal = strstr(param_str, "=\"");
- if( equal && equal - param_str + 1 > 2 && param_str[len-1] == '"' ) {
- size_t dst = equal + 1 - param_str;
- size_t src = dst + 1;
- for( ; param_str[src]; dst++, src++)
- {
- if( param_str[src] == '"' ) {
- if( param_str[src+1] == '"' ) {
- src++;
- } else {
- break;
- }
- }
- param_str[dst] = param_str[src];
- }
- param_str[dst] = '\0';
- }
-
-}
-
-
/* create parameter list entry */
paralist *pj_mkparam(const char *str) {
paralist *newitem;
@@ -44,7 +19,6 @@ paralist *pj_mkparam(const char *str) {
if (*str == '+')
++str;
(void)strcpy(newitem->param, str);
- unquote_string(newitem->param);
}
return newitem;
}
@@ -86,7 +60,6 @@ paralist *pj_mkparam_ws (const char *str, const char **next_str) {
if (nullptr==newitem)
return nullptr;
memcpy(newitem->param, str, len);
- unquote_string(newitem->param);
newitem->used = 0;
newitem->next = nullptr;