diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2017-05-30 16:13:46 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2017-05-30 16:13:46 +0200 |
| commit | 73993d15324dacfd6eba7c19707687d2c51bba6a (patch) | |
| tree | 2841f2ea09c5ff1f16bb85487829c2c49751db67 | |
| parent | c5b617aadf9dfc036856303d1882cfaa98b00825 (diff) | |
| download | PROJ-73993d15324dacfd6eba7c19707687d2c51bba6a.tar.gz PROJ-73993d15324dacfd6eba7c19707687d2c51bba6a.zip | |
PJ_ob_tran: avoid infinite recursion on +proj=ob_tran +o_proj=ob_tran
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1932
Credit to OSS Fuzz
| -rw-r--r-- | src/PJ_ob_tran.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/PJ_ob_tran.c b/src/PJ_ob_tran.c index 96752e8d..d789b3f5 100644 --- a/src/PJ_ob_tran.c +++ b/src/PJ_ob_tran.c @@ -111,6 +111,8 @@ PJ *PROJECTION(ob_tran) { /* get name of projection to be translated */ if (!(name = pj_param(P->ctx, P->params, "so_proj").s)) E_ERROR(-26); + /* avoid endless recursion */ + if( strcmp(name, "ob_tran") == 0 ) E_ERROR(-37); for (i = 0; (s = pj_list[i].id) && strcmp(name, s) ; ++i) ; if (!s || !(Q->link = (*pj_list[i].proj)(0))) E_ERROR(-37); /* copy existing header into new */ |
