]> granicus.if.org Git - postgis/commitdiff
Guard against lookup failure, to avoid segfault in internally called case (references...
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 16 Apr 2018 17:26:57 +0000 (17:26 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 16 Apr 2018 17:26:57 +0000 (17:26 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@16542 b70326c6-7e19-0410-871a-916f4a2858ee

libpgcommon/lwgeom_transform.c

index a6c46c22be77f8d079afaf21e6b5f7d6fcec55bf..b793635a9ec9ea1a6f227a18575cf604b1b79bbb 100644 (file)
@@ -696,6 +696,9 @@ SetSpatialRefSysSchema(FunctionCallInfo fcinfo)
        if (!fcinfo || !fcinfo->flinfo) return;
 
        nsp_name = get_namespace_name(get_func_namespace(fcinfo->flinfo->fn_oid));
+       /* early exit if we cannot lookup nsp_name, cf #4067 */
+       if (!nsp_name) return;
+
        elog(DEBUG4, "%s located %s in namespace %s", __func__, get_func_name(fcinfo->flinfo->fn_oid), nsp_name);
        spatialRefSysSchema = MemoryContextStrdup(CacheMemoryContext, nsp_name);;
        return;