From 73993d15324dacfd6eba7c19707687d2c51bba6a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 30 May 2017 16:13:46 +0200 Subject: 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 --- src/PJ_ob_tran.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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 */ -- cgit v1.2.3