Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mapserver for openSUSE:Factory checked in at 2021-12-01 20:47:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mapserver (Old) and /work/SRC/openSUSE:Factory/.mapserver.new.31177 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mapserver" Wed Dec 1 20:47:23 2021 rev:4 rq:934922 version:7.6.4 Changes: -------- --- /work/SRC/openSUSE:Factory/mapserver/mapserver.changes 2021-06-16 20:36:39.983307087 +0200 +++ /work/SRC/openSUSE:Factory/.mapserver.new.31177/mapserver.changes 2021-12-02 02:17:47.694168918 +0100 @@ -1,0 +2,27 @@ +Thu Nov 11 16:38:03 UTC 2021 - Boris Manojlovic <[email protected]> + + +- update to release 7.6.4 + * PostGIS: fix ST_Intersects() with collections with PostGIS < 2.5. + Fixes https://github.com/MapServer/MapServer/pull/6355#issuecomment-877290417 (Even Rouault) : 3e42e35 + * Check if sizeunits is not set to pixels (Patrik Sylve) : 3688004 + * Change legend symbol scale factor when SIZEUNITS is set to METERS (Patrik Sylve) : 39a4ead + * spatialindex for sqlite sources in filter (Wouter Visscher) : 955d14e + * Make sure requested class with mode=legendicon is not negative. ( #6357 ) (Steve Lime) : 0901b57 + * Updates to CONTRIBUTING.md (Jeff McKenna) : ee6297a + * PostGIS: fix ST_Intersects() with bounding box that is a point (follow-up of fixes #6181 , fixes #6230 ) + (fixes https://github.com/MapServer/MapServer/pull/6347#issuecomment-870002856) (Even Rouault) : 44d5d9c + * WMS: make attribute color binding work with FILTER vendor parameter (fixes #6200 ) (Even Rouault) : 1a98ac7 + * msQueryByFeatures(): avoid potential segfault when reslut set is empty (Even Rouault) : 98ad83a + * PostGIS: use ST_Intersects instead of && for bounding box (fixes #6181 , fixes #6230 ) (Even Rouault) : e2ef155 + * check_single_font(): use quotation mark when msGetGlyphIndex() fails to retrieve the glyph (Even Rouault) : 53ee29e + * msGetGlyphByIndex() / msGetGlyphOutline(): tweak debug/error messages (Even Rouault) : 0bbf943 + * When a font is missing a glyph we try to fallback to using a question mark (Krister Wicksell) : cf4756e + * WFS: fix paging with GPKG/Spatialite datasources and non-point geometries (fixes #6325 ) (Even Rouault) : ce8dc4d + * Fix querymap failure for polygon layers with labels only (no styles) ( #6262 ) (Tamas Szekeres) : 782ee8b + * mapxbase: validate nHeadLen (Max Kellermann) : ee5d5de + * mapshape, mapxbase: fix several memory leaks in error code paths (Max Kellermann) : 5e4c504 + * mapshape: validate numshapes (Max Kellermann) : b5c0e29 + * mapshape: remove useless null terminator (Max Kellermann) : 9755395 + +------------------------------------------------------------------- Old: ---- mapserver-7.6.3.tar.gz New: ---- mapserver-7.6.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mapserver.spec ++++++ --- /var/tmp/diff_new_pack.lWQxyx/_old 2021-12-02 02:17:48.146167342 +0100 +++ /var/tmp/diff_new_pack.lWQxyx/_new 2021-12-02 02:17:48.146167342 +0100 @@ -17,6 +17,7 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # + %bcond_with ruby # @@ -30,12 +31,12 @@ %endif Name: mapserver -Version: 7.6.3 +Version: 7.6.4 Release: 0 Summary: Environment for building spatially-enabled internet applications License: MIT Group: Productivity/Networking/Web/Servers -Url: https://www.mapserver.org/ +URL: https://www.mapserver.org/ Source: https://download.osgeo.org/mapserver/%{name}-%{version}.tar.gz Source9: %{name}-rpmlintrc # PATCH-FIX-UPSTREAM mapserver-7.6.1-fix_python_install_path.patch fixing python installation path badly defaulting to arch independent location @@ -72,8 +73,8 @@ %if 0%{?suse_version} >= 1500 BuildRequires: postgresql-server-devel >= 9.1 %endif -BuildRequires: proj BuildRequires: libprotobuf-c-devel +BuildRequires: proj BuildRequires: protobuf-c BuildRequires: readline-devel BuildRequires: rpm @@ -99,9 +100,9 @@ Mapserver library for mapserver or mapscript module. you need this lib to run mapserver or any of the mapscript module (php, java, python, ruby) + # We don't require apache2_mod-php5 users could have php5 running # with other modes (cgi, php-fpm etc) - %package -n php-mapscript Summary: PHP/Mapscript map making extensions to PHP Group: Development/Libraries/Other ++++++ mapserver-7.6.3.tar.gz -> mapserver-7.6.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/CMakeLists.txt new/mapserver-7.6.4/CMakeLists.txt --- old/mapserver-7.6.3/CMakeLists.txt 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/CMakeLists.txt 2021-07-12 22:16:21.000000000 +0200 @@ -17,7 +17,7 @@ set (MapServer_VERSION_MAJOR 7) set (MapServer_VERSION_MINOR 6) -set (MapServer_VERSION_REVISION 3) +set (MapServer_VERSION_REVISION 4) set (MapServer_VERSION_SUFFIX "") # Set C++ version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/CONTRIBUTING.md new/mapserver-7.6.4/CONTRIBUTING.md --- old/mapserver-7.6.3/CONTRIBUTING.md 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/CONTRIBUTING.md 2021-07-12 22:16:21.000000000 +0200 @@ -5,28 +5,33 @@ ## Bugs and Help -GitHub issues should only be created to log bugs. For general help and support the MapServer [mailing lists](http://mapserver.org/community/lists.html) +GitHub issues should only be created to log bugs. For general help and support the MapServer [mailing lists](https://mapserver.org/community/lists.html) should be used. If you are unsure if you have discovered a bug, or may need help with configuring MapServer please -post to the [mapserver-users list](http://lists.osgeo.org/mailman/listinfo/mapserver-users). There is also -a [MapServer FAQ](http://www.mapserver.org/faq.html) which may have a solution to your problem. +post to the [mapserver-users list](https://lists.osgeo.org/mailman/listinfo/mapserver-users). There is also +a [MapServer FAQ](https://mapserver.org/faq.html) which may have a solution to your problem. -If you have discovered a bug, please refer to the [Bug Submission page](http://mapserver.org/development/bugs.html) for +If you have discovered a bug, please refer to the [Bug Submission page](https://mapserver.org/development/bugs.html) for guidelines on creating an issue on GitHub. Please also search the existing issues to see if the bug has already been reported, and add any further details to the existing issue. -For professional support please see the [MapServer Service Providers page](http://mapserver.org/community/service_providers.html). +For professional support please see the [MapServer Service Providers page](https://mapserver.org/community/service_providers.html). ## Development -A separate [mapserver-dev mailing list](http://lists.osgeo.org/mailman/listinfo/mapserver-dev) is available for developers -working on the MapServer code. - -Details on using GitHub can be found on the [MapServer GitHub page](http://mapserver.org/development/git.html) +A separate [mapserver-dev mailing list](https://lists.osgeo.org/mailman/listinfo/mapserver-dev) is available for developers +working on the MapServer code. Send a short message there to introduce yourself +to the community, and mention what you are interested in working on. + +Details on using GitHub can be found on the [MapServer GitHub page](https://mapserver.org/development/git.html). + +Request for Comments (RFCs), where upcoming major changes to the source +code are proposed, and a description of the various software tests & release +plans, can be found on the [MapServer Development page](https://mapserver.org/development/). Additional developer notes can be found in the [MapServer wiki](https://github.com/mapserver/mapserver/wiki#developer-notes), including coding style and guidelines, memory management, and working with Git. ## Documentation -The MapServer documentation is stored in a [separate repository](https://github.com/mapserver/docs). Please submit any documentation -issues or changes there. See the [Documentation Development Guide](http://mapserver.org/development/documentation.html) for further details. +The MapServer documentation is stored in a [separate repository](https://github.com/MapServer/MapServer-documentation). Please submit any documentation +issues or changes there. See the [Documentation Development Guide](https://mapserver.org/development/documentation.html) for further details. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/HISTORY.TXT new/mapserver-7.6.4/HISTORY.TXT --- old/mapserver-7.6.3/HISTORY.TXT 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/HISTORY.TXT 2021-07-12 22:16:21.000000000 +0200 @@ -10,7 +10,18 @@ For a complete change history, please see the Git log comments. For more details about recent point releases, please see the online changelog at: -http://mapserver.org/development/changelog/ +https://mapserver.org/development/changelog/ + +7.6.4 release (2021-07-12) +-------------------------- + +- improved performance of GPKG and SpatiaLite queries (#6361) + +- WFS: fix paging with GPKG/Spatialite datasources and non-point geometries (#6325) + +- PostGIS: use ST_Intersects instead of && for bounding box (#6348) + +see detailed changelog for other fixes 7.6.3 release (2021-04-30) ------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/ci/travis/after_success.sh new/mapserver-7.6.4/ci/travis/after_success.sh --- old/mapserver-7.6.3/ci/travis/after_success.sh 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/ci/travis/after_success.sh 2021-07-12 22:16:21.000000000 +0200 @@ -1,11 +1,11 @@ #!/bin/sh set -eu -if [ "$BUILD_NAME" != "PHP_7.2_WITH_ASAN" ]; then - # Only run coverage when it is safe to do so (not on pull requests), and only on master branch +if [ "$BUILD_NAME" != "PHP_7.3_WITH_ASAN" ]; then + # Only run coverage when it is safe to do so (not on pull requests), and only on main branch echo "$TRAVIS_SECURE_ENV_VARS" echo "$TRAVIS_BRANCH" - sh -c 'if test "$TRAVIS_SECURE_ENV_VARS" = "true" -a "$TRAVIS_BRANCH" = "master"; then echo "run coverage"; ./run_code_coverage_upload.sh; fi' + sh -c 'if test "$TRAVIS_SECURE_ENV_VARS" = "true" -a "$TRAVIS_BRANCH" = "main"; then echo "run coverage"; ./run_code_coverage_upload.sh; fi' ln -s ../../../mapparser.y build/CMakeFiles/mapserver.dir/ ln -s ../../../maplexer.l build/CMakeFiles/mapserver.dir/ coveralls --exclude renderers --exclude mapscript --exclude apache --exclude build/mapscript/mapscriptJAVA_wrap.c --exclude build/mapscript/mapscriptPYTHON_wrap.c --exclude shp2img.c --exclude legend.c --exclude scalebar.c --exclude msencrypt.c --exclude sortshp.c --exclude shptreevis.c --exclude shptree.c --exclude testexpr.c --exclude sym2img.c --exclude testcopy.c --exclude shptreetst.c --exclude tile4ms.c --exclude proj --exclude swig-3.0.12 --extension .c --extension .cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/ci/travis/before_install.sh new/mapserver-7.6.4/ci/travis/before_install.sh --- old/mapserver-7.6.3/ci/travis/before_install.sh 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/ci/travis/before_install.sh 2021-07-12 22:16:21.000000000 +0200 @@ -1,31 +1,38 @@ #!/bin/sh set -eu -sudo mv /etc/apt/sources.list.d/pgdg* /tmp -dpkg -l | grep postgresql -dpkg -l | grep postgis -sudo apt-get remove postgresql* -sudo add-apt-repository -y ppa:ubuntugis/ppa -sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-testing +# Remove pre-installed things in Travis image +if ls /etc/apt/sources.list.d/pgdg* 2>/dev/null >/dev/null; then sudo mv /etc/apt/sources.list.d/pgdg* /tmp; fi +dpkg -l | grep postgresql || /bin/true +dpkg -l | grep postgis || /bin/true +sudo apt-get remove --purge postgresql* libpq-dev libpq5 || /bin/true + +sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable sudo apt-get update -sudo apt-get install --allow-unauthenticated protobuf-c-compiler libprotobuf-c0-dev bison flex python-lxml libfribidi-dev cmake librsvg2-dev colordiff libpq-dev libpng12-dev libjpeg-dev libgif-dev libgeos-dev libgd2-xpm-dev libfreetype6-dev libfcgi-dev libcurl4-gnutls-dev libcairo2-dev libgdal1-dev libproj-dev libxml2-dev python-dev libexempi-dev lcov lftp postgis libharfbuzz-dev gdal-bin ccache curl pyflakes -sudo apt-get install --allow-unauthenticated libmono-system-drawing4.0-cil mono-mcs -sudo apt-get install --allow-unauthenticated php5-dev || sudo apt-get install --allow-unauthenticated php7-dev -sudo apt-get install --allow-unauthenticated libperl-dev -sudo pip install cpp-coveralls +sudo apt-get install -y --allow-unauthenticated protobuf-c-compiler libprotobuf-c0-dev bison flex libfribidi-dev cmake librsvg2-dev colordiff libpq-dev libpng-dev libjpeg-dev libgif-dev libgeos-dev libfreetype6-dev libfcgi-dev libcurl4-gnutls-dev libcairo2-dev libgdal-dev libproj-dev libxml2-dev libexempi-dev lcov lftp postgis libharfbuzz-dev gdal-bin ccache curl postgresql-server-dev-10 postgresql-10-postgis-3 postgresql-10-postgis-3-scripts swig g++ +# following are already installed on Travis CI +#sudo apt-get install --allow-unauthenticated php-dev python-dev python3-dev +sudo apt-get install -y --allow-unauthenticated libmono-system-drawing4.0-cil mono-mcs +sudo apt-get install -y --allow-unauthenticated libperl-dev +sudo apt-get install -y --allow-unauthenticated openjdk-8-jdk + +pip install cpp-coveralls pyflakes lxml sudo pip install -U -r msautotest/requirements.txt -# install swig 3.0.12 (defaults to 2.0.11 on trusty) -wget http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz + export CC="ccache gcc" export CXX="ccache g++" -tar xf swig-3.0.12.tar.gz -cd swig-3.0.12 && ./configure --prefix=/usr && make -j2 && sudo make install -swig -version -cd .. + +sudo sed -i 's/md5/trust/' /etc/postgresql/10/main/pg_hba.conf +sudo sed -i 's/peer/trust/' /etc/postgresql/10/main/pg_hba.conf +sudo service postgresql restart 10 + cd msautotest -pyflakes . +python -m pyflakes . ./create_postgis_test_data.sh -python -m SimpleHTTPServer &> /dev/null & + +# py3 +python -m http.server &> /dev/null & + cd .. touch maplexer.l touch mapparser.y diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/ci/travis/script.sh new/mapserver-7.6.4/ci/travis/script.sh --- old/mapserver-7.6.3/ci/travis/script.sh 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/ci/travis/script.sh 2021-07-12 22:16:21.000000000 +0200 @@ -1,13 +1,13 @@ #!/bin/sh set -eu -if [ "$BUILD_NAME" = "PHP_7.2_WITH_ASAN" ]; then - export CC="ccache clang" - export CXX="ccache clang++" -else +#if [ "$BUILD_NAME" = "PHP_7.3_WITH_ASAN" ]; then +# export CC="ccache clang" +# export CXX="ccache clang++" +#else export CC="ccache gcc" export CXX="ccache g++" -fi +#fi curl http://download.osgeo.org/proj/proj-6.1.1.tar.gz > proj-6.1.1.tar.gz tar xzf proj-6.1.1.tar.gz @@ -16,7 +16,7 @@ (cd proj; CFLAGS='-O2 -DPROJ_RENAME_SYMBOLS' CXXFLAGS='-O2 -DPROJ_RENAME_SYMBOLS' ./configure --disable-static --prefix=/usr/local && CCACHE_CPP2=yes make -j2 && sudo make -j3 install) sudo rm -f /usr/include/proj_api.h -if [ "$BUILD_NAME" = "PHP_7.2_WITH_ASAN" ]; then +if [ "$BUILD_NAME" = "PHP_7.3_WITH_ASAN" ]; then # Force use of PROJ 4 API sudo rm /usr/local/include/proj.h # -DNDEBUG to avoid issues with cairo cleanup @@ -24,7 +24,7 @@ export AUTOTEST_OPTS="--strict --run_under_asan" # Only run tests that only involve mapserv/shp2img binaries. mspython, etc would require LD_PREOLOAD'ing the asan shared object make -j4 asan_compatible_tests -elif [ "$BUILD_NAME" = "PHP_7.3_WITH_PROJ6" ]; then +elif [ "$BUILD_NAME" = "PHP_7.4_WITH_PROJ6" ]; then # Avoid any use of PROJ 4 API sudo rm -f /usr/include/proj_api.h make cmakebuild MFLAGS="-j2" CMAKE_C_FLAGS="-O2 -DPROJ_RENAME_SYMBOLS" CMAKE_CXX_FLAGS="-O2 -DPROJ_RENAME_SYMBOLS" EXTRA_CMAKEFLAGS="-DPROJ_INCLUDE_DIR=/usr/local/include -DPROJ_LIBRARY=/usr/local/lib/libproj.so.15" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/fontcache.c new/mapserver-7.6.4/fontcache.c --- old/mapserver-7.6.3/fontcache.c 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/fontcache.c 2021-07-12 22:16:21.000000000 +0200 @@ -287,8 +287,14 @@ FT_Set_Pixel_Sizes(face->face,0,MS_NINT(size * 96/72.0)); } error = FT_Load_Glyph(face->face,key.codepoint,FT_LOAD_DEFAULT|FT_LOAD_NO_BITMAP|FT_LOAD_NO_HINTING|FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); + if (error) { + msDebug("Unable to load glyph %u for font \"%s\". Using ? as fallback.\n", key.codepoint, face->font); + // If we can't find a glyph then try to fallback to a question mark. + unsigned int fallbackCodepoint = msGetGlyphIndex(face, 0x3F); + error = FT_Load_Glyph(face->face,fallbackCodepoint,FT_LOAD_DEFAULT|FT_LOAD_NO_BITMAP|FT_LOAD_NO_HINTING|FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); + } if(error) { - msSetError(MS_MISCERR, "unable to load glyph %ud for font \"%s\"", "msGetGlyphByIndex()",key.codepoint, face->font); + msSetError(MS_MISCERR, "unable to load glyph %u for font \"%s\"", "msGetGlyphByIndex()",key.codepoint, face->font); free(gc); #ifdef USE_THREAD if (use_global_ft_cache) @@ -335,8 +341,14 @@ pen.x = pen.y = 0; FT_Set_Transform(face->face, &matrix, &pen); error = FT_Load_Glyph(face->face,glyph->key.codepoint,FT_LOAD_DEFAULT|FT_LOAD_NO_BITMAP/*|FT_LOAD_IGNORE_TRANSFORM*/|FT_LOAD_NO_HINTING|FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); + if (error) { + msDebug("Unable to load glyph %u for font \"%s\". Using ? as fallback.\n", glyph->key.codepoint, face->font); + // If we can't find a glyph then try to fallback to a question mark. + unsigned int fallbackCodepoint = msGetGlyphIndex(face, 0x3F); + error = FT_Load_Glyph(face->face,fallbackCodepoint,FT_LOAD_DEFAULT|FT_LOAD_NO_BITMAP/*|FT_LOAD_IGNORE_TRANSFORM*/|FT_LOAD_NO_HINTING|FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); + } if(error) { - msSetError(MS_MISCERR, "unable to load glyph %ud for font \"%s\"", "msGetGlyphByIndex()",glyph->key.codepoint, face->font); + msSetError(MS_MISCERR, "unable to load glyph %u for font \"%s\"", "msGetGlyphOutline()",glyph->key.codepoint, face->font); #ifdef USE_THREAD if (use_global_ft_cache) msReleaseLock(TLOCK_TTF); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/mapdraw.c new/mapserver-7.6.4/mapdraw.c --- old/mapserver-7.6.3/mapdraw.c 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/mapdraw.c 2021-07-12 22:16:21.000000000 +0200 @@ -1307,7 +1307,7 @@ { int i, status; char annotate=MS_TRUE, cache=MS_FALSE; - int drawmode = MS_DRAWMODE_FEATURES|MS_DRAWMODE_QUERY; + int drawmode = MS_DRAWMODE_FEATURES; shapeObj shape; int maxnumstyles=1; @@ -1356,13 +1356,16 @@ /* if MS_HILITE, alter the one style (always at least 1 style), and set a MINDISTANCE for the labelObj to avoid duplicates */ if(map->querymap.style == MS_HILITE) { + + drawmode |= MS_DRAWMODE_QUERY; + if (layer->numclasses > 0) { colorbuffer = (colorObj*)msSmallMalloc(layer->numclasses*sizeof(colorObj)); mindistancebuffer = (int*)msSmallMalloc(layer->numclasses*sizeof(int)); } for(i=0; i<layer->numclasses; i++) { - if(layer->type == MS_LAYER_POLYGON) { /* alter BOTTOM style since that's almost always the fill */ + if(layer->type == MS_LAYER_POLYGON && layer->class[i]->numstyles > 0) { /* alter BOTTOM style since that's almost always the fill */ if (layer->class[i]->styles == NULL) { msSetError(MS_MISCERR, "Don't know how to draw class %s of layer %s without a style definition.", "msDrawQueryLayer()", layer->class[i]->name, layer->name); msFree(colorbuffer); @@ -1521,7 +1524,7 @@ /* if MS_HILITE, restore color and mindistance values */ if(map->querymap.style == MS_HILITE) { for(i=0; i<layer->numclasses; i++) { - if(layer->type == MS_LAYER_POLYGON) { + if(layer->type == MS_LAYER_POLYGON && layer->class[i]->numstyles > 0) { if(MS_VALID_COLOR(layer->class[i]->styles[0]->color)) layer->class[i]->styles[0]->color = colorbuffer[i]; else if(MS_VALID_COLOR(layer->class[i]->styles[0]->outlinecolor)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/maplegend.c new/mapserver-7.6.4/maplegend.c --- old/mapserver-7.6.3/maplegend.c 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/maplegend.c 2021-07-12 22:16:21.000000000 +0200 @@ -189,6 +189,12 @@ /* ** now draw the appropriate color/symbol/size combination */ + + /* Scalefactor will be infinity when SIZEUNITS is set in LAYER */ + if(lp->sizeunits != MS_PIXELS) { + lp->scalefactor = 1.0; + } + switch(type) { case MS_LAYER_POINT: marker.x = dstX + MS_NINT(width / 2.0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/mapogr.cpp new/mapserver-7.6.4/mapogr.cpp --- old/mapserver-7.6.3/mapogr.cpp 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/mapogr.cpp 2021-07-12 22:16:21.000000000 +0200 @@ -2272,66 +2272,6 @@ bool bSpatialiteOrGPKGAddOrderByFID = false; - if( psInfo->dialect && psInfo->pszMainTableName != NULL && - ( (EQUAL(psInfo->dialect, "Spatialite") && psInfo->bHasSpatialIndex) - || EQUAL(psInfo->dialect, "GPKG") ) && - bIsValidRect ) - { - select = msStringConcatenate(select, " JOIN "); - - char szSpatialIndexName[256]; - snprintf( szSpatialIndexName, sizeof(szSpatialIndexName), - "%s_%s_%s", - EQUAL(psInfo->dialect, "Spatialite") ? "idx" : "rtree", - psInfo->pszSpatialFilterTableName, - psInfo->pszSpatialFilterGeometryColumn ); - char* pszEscapedSpatialIndexName = msLayerEscapePropertyName( - layer, szSpatialIndexName); - select = msStringConcatenate(select, "\""); - select = msStringConcatenate(select, pszEscapedSpatialIndexName); - msFree(pszEscapedSpatialIndexName); - select = msStringConcatenate(select, "\" ms_spat_idx ON \""); - char* pszEscapedMainTableName = msLayerEscapePropertyName( - layer, psInfo->pszMainTableName); - select = msStringConcatenate(select, pszEscapedMainTableName); - msFree(pszEscapedMainTableName); - select = msStringConcatenate(select, "\"."); - if( psInfo->pszRowId ) - { - char* pszEscapedRowId = msLayerEscapePropertyName( - layer, psInfo->pszRowId); - select = msStringConcatenate(select, "\""); - select = msStringConcatenate(select, pszEscapedRowId); - select = msStringConcatenate(select, "\""); - msFree(pszEscapedRowId); - } - else - select = msStringConcatenate(select, "ROWID"); - if( EQUAL(psInfo->dialect, "Spatialite") ) - select = msStringConcatenate(select, " = ms_spat_idx.pkid AND "); - else - select = msStringConcatenate(select, " = ms_spat_idx.id AND "); - - char szCond[256]; - if( EQUAL(psInfo->dialect, "Spatialite") ) - { - snprintf(szCond, sizeof(szCond), - "ms_spat_idx.xmin <= %.15g AND ms_spat_idx.xmax >= %.15g AND " - "ms_spat_idx.ymin <= %.15g AND ms_spat_idx.ymax >= %.15g", - rect.maxx, rect.minx, rect.maxy, rect.miny); - } - else - { - snprintf(szCond, sizeof(szCond), - "ms_spat_idx.minx <= %.15g AND ms_spat_idx.maxx >= %.15g AND " - "ms_spat_idx.miny <= %.15g AND ms_spat_idx.maxy >= %.15g", - rect.maxx, rect.minx, rect.maxy, rect.miny); - } - select = msStringConcatenate(select, szCond); - - bSpatialiteOrGPKGAddOrderByFID = true; - } - const char *sql = layer->filter.native_string; if (psInfo->dialect && sql && *sql != '\0' && (EQUAL(psInfo->dialect, "Spatialite") || @@ -2368,16 +2308,102 @@ msFree(points); filter = msStringConcatenate(filter, "))"); } - else if( psInfo->dialect && EQUAL(psInfo->dialect, "Spatialite") && - psInfo->pszMainTableName != NULL && !psInfo->bHasSpatialIndex ) + else if( psInfo->dialect && + (EQUAL(psInfo->dialect, "Spatialite") || + EQUAL(psInfo->dialect, "GPKG")) && + psInfo->pszMainTableName != NULL ) { + if( (EQUAL(psInfo->dialect, "Spatialite") && psInfo->bHasSpatialIndex) + || EQUAL(psInfo->dialect, "GPKG") ) + { + if (filter) filter = msStringConcatenate(filter, " AND "); + char* pszEscapedMainTableName = msLayerEscapePropertyName( + layer, psInfo->pszMainTableName); + filter = msStringConcatenate(filter, "\""); + filter = msStringConcatenate(filter, pszEscapedMainTableName); + msFree(pszEscapedMainTableName); + filter = msStringConcatenate(filter, "\"."); + if( psInfo->pszRowId ) + { + char* pszEscapedRowId = msLayerEscapePropertyName( + layer, psInfo->pszRowId); + filter = msStringConcatenate(filter, "\""); + filter = msStringConcatenate(filter, pszEscapedRowId); + filter = msStringConcatenate(filter, "\""); + msFree(pszEscapedRowId); + } + else + filter = msStringConcatenate(filter, "ROWID"); + + filter = msStringConcatenate(filter, " IN "); + filter = msStringConcatenate(filter, "("); + filter = msStringConcatenate(filter, "SELECT "); + + if( EQUAL(psInfo->dialect, "Spatialite") ) + filter = msStringConcatenate(filter, "ms_spat_idx.pkid"); + else + filter = msStringConcatenate(filter, "ms_spat_idx.id"); + + filter = msStringConcatenate(filter, " FROM "); + + char szSpatialIndexName[256]; + snprintf( szSpatialIndexName, sizeof(szSpatialIndexName), + "%s_%s_%s", + EQUAL(psInfo->dialect, "Spatialite") ? "idx" : "rtree", + psInfo->pszSpatialFilterTableName, + psInfo->pszSpatialFilterGeometryColumn ); + char* pszEscapedSpatialIndexName = msLayerEscapePropertyName( + layer, szSpatialIndexName); + + filter = msStringConcatenate(filter, "\""); + filter = msStringConcatenate(filter, pszEscapedSpatialIndexName); + msFree(pszEscapedSpatialIndexName); + + filter = msStringConcatenate(filter, "\" ms_spat_idx WHERE "); + + char szCond[256]; + if( EQUAL(psInfo->dialect, "Spatialite") ) + { + snprintf(szCond, sizeof(szCond), + "ms_spat_idx.xmin <= %.15g AND ms_spat_idx.xmax >= %.15g AND " + "ms_spat_idx.ymin <= %.15g AND ms_spat_idx.ymax >= %.15g", + rect.maxx, rect.minx, rect.maxy, rect.miny); + } + else + { + snprintf(szCond, sizeof(szCond), + "ms_spat_idx.minx <= %.15g AND ms_spat_idx.maxx >= %.15g AND " + "ms_spat_idx.miny <= %.15g AND ms_spat_idx.maxy >= %.15g", + rect.maxx, rect.minx, rect.maxy, rect.miny); + } + filter = msStringConcatenate(filter, szCond); + + filter = msStringConcatenate(filter, ")"); + + bSpatialiteOrGPKGAddOrderByFID = true; + } + + const bool isGPKG = EQUAL(psInfo->dialect, "GPKG"); if (filter) filter = msStringConcatenate(filter, " AND"); const char *col = OGR_L_GetGeometryColumn(psInfo->hLayer); // which geom field?? - filter = msStringConcatenate(filter, " MbrIntersects(\""); + filter = msStringConcatenate(filter, " Intersects("); + if( isGPKG ) + { + // Casting GeoPackage geometries to spatialie ones is done + // automatically normally, since GDAL enables the + // "amphibious" mode, but without it + // explicilty specified, spatialite 4.3.0a does an + // out-of-bounds access. + filter = msStringConcatenate(filter, "GeomFromGPB("); + } + filter = msStringConcatenate(filter, "\""); char* escaped = msLayerEscapePropertyName(layer, col); filter = msStringConcatenate(filter, escaped); msFree(escaped); - filter = msStringConcatenate(filter, "\", BuildMbr("); + filter = msStringConcatenate(filter, "\""); + if( isGPKG ) + filter = msStringConcatenate(filter, ")"); + filter = msStringConcatenate(filter, ", BuildMbr("); char *points = (char *)msSmallMalloc(30*2*5); snprintf(points, 30*4, "%lf,%lf,%lf,%lf", rect.minx, rect.miny, rect.maxx, rect.maxy); filter = msStringConcatenate(filter, points); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/mappostgis.c new/mapserver-7.6.4/mappostgis.c --- old/mapserver-7.6.3/mappostgis.c 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/mappostgis.c 2021-07-12 22:16:21.000000000 +0200 @@ -1666,37 +1666,44 @@ char *strBox = NULL; size_t sz; + const int bIsPoint = rect->minx == rect->maxx && rect->miny == rect->maxy; if (layer->debug) { msDebug("msPostGISBuildSQLBox called.\n"); } if ( strSRID ) { - static char *strBoxTemplate = "ST_GeomFromText('POLYGON((%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g))',%s)"; + static const char *strBoxTemplate = "ST_GeomFromText('POLYGON((%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g))',%s)"; + static const char *strBoxTemplatePoint = "ST_GeomFromText('POINT(%.15g %.15g)',%s)"; /* 10 doubles + 1 integer + template characters */ sz = 10 * 22 + strlen(strSRID) + strlen(strBoxTemplate); strBox = (char*)msSmallMalloc(sz+1); /* add space for terminating NULL */ - if ( sz <= snprintf(strBox, sz, strBoxTemplate, + if ( (bIsPoint && sz <= (size_t)(snprintf(strBox, sz, strBoxTemplatePoint, + rect->minx, rect->miny, strSRID))) || + (!bIsPoint && sz <= (size_t)(snprintf(strBox, sz, strBoxTemplate, rect->minx, rect->miny, rect->minx, rect->maxy, rect->maxx, rect->maxy, rect->maxx, rect->miny, rect->minx, rect->miny, - strSRID)) { + strSRID))) ) { msSetError(MS_MISCERR,"Bounding box digits truncated.","msPostGISBuildSQLBox"); return NULL; } } else { - static char *strBoxTemplate = "ST_GeomFromText('POLYGON((%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g))')"; + static const char *strBoxTemplate = "ST_GeomFromText('POLYGON((%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g))')"; + static const char *strBoxTemplatePoint = "ST_GeomFromText('POINT(%.15g %.15g)')"; /* 10 doubles + template characters */ sz = 10 * 22 + strlen(strBoxTemplate); strBox = (char*)msSmallMalloc(sz+1); /* add space for terminating NULL */ - if ( sz <= snprintf(strBox, sz, strBoxTemplate, + if ( (bIsPoint && sz <= (size_t)(snprintf(strBox, sz, strBoxTemplatePoint, + rect->minx, rect->miny))) || + (!bIsPoint && sz <= (size_t)(snprintf(strBox, sz, strBoxTemplate, rect->minx, rect->miny, rect->minx, rect->maxy, rect->maxx, rect->maxy, rect->maxx, rect->miny, - rect->minx, rect->miny) ) { + rect->minx, rect->miny))) ) { msSetError(MS_MISCERR,"Bounding box digits truncated.","msPostGISBuildSQLBox"); return NULL; } @@ -2055,7 +2062,6 @@ char *strBox = 0; char *strSRID = 0; size_t strBoxLength = 0; - static const char *strRectTemplate = "\"%s\" && %s"; /* We see to set the SRID on the box, but to what SRID? */ strSRID = msPostGISBuildSQLSRID(layer); @@ -2066,27 +2072,53 @@ } strBox = msPostGISBuildSQLBox(layer, rect, strSRID); - msFree(strSRID); if ( strBox ) { strBoxLength = strlen(strBox); } else { msSetError(MS_MISCERR, "Unable to build box SQL.", "msPostGISBuildSQLWhere()"); free( strLimit ); free( strOffset ); + msFree(strSRID); return NULL; } - strRect = (char*)msSmallMalloc(strlen(strRectTemplate) + strBoxLength + strlen(layerinfo->geomcolumn) +1 ); - sprintf(strRect, strRectTemplate, layerinfo->geomcolumn, strBox); + if( strstr(strSRID, "find_srid(") == NULL ) + { + // If the SRID is known, we can safely use ST_Intersects() + // otherwise if find_srid() would return 0, ST_Intersects() would not + // work at all, which breaks the msautotest/query/query_postgis.map + // tests, releated to bdry_counpy2 layer that has no SRID + if( layerinfo->version >= 20500 ) + { + static const char *strRectTemplate = "ST_Intersects(\"%s\", %s)"; + strRect = (char*)msSmallMalloc(strlen(strRectTemplate) + strBoxLength + strlen(layerinfo->geomcolumn) +1 ); + sprintf(strRect, strRectTemplate, layerinfo->geomcolumn, strBox); + } + else + { + // ST_Intersects() before PostGIS 2.5 doesn't support collections + // See https://github.com/MapServer/MapServer/pull/6355#issuecomment-877355007 + static const char *strRectTemplate = "(\"%s\" && %s) AND ST_Distance(\"%s\", %s) = 0"; + strRect = (char*)msSmallMalloc(strlen(strRectTemplate) + 2 * (strBoxLength + strlen(layerinfo->geomcolumn)) +1 ); + sprintf(strRect, strRectTemplate, layerinfo->geomcolumn, strBox, layerinfo->geomcolumn, strBox); + } + } + else + { + static const char *strRectTemplate = "\"%s\" && %s"; + strRect = (char*)msSmallMalloc(strlen(strRectTemplate) + strBoxLength + strlen(layerinfo->geomcolumn) +1 ); + sprintf(strRect, strRectTemplate, layerinfo->geomcolumn, strBox); + } strRectLength = strlen(strRect); free(strBox); + msFree(strSRID); /* Combine with other rectangle expressed in another SRS */ /* (generally equivalent to the above in current code paths) */ if( rectInOtherSRID != NULL && otherSRID > 0 ) { char* strRectOtherSRID; - static const char *strRectOtherSRIDTemplate = "NOT ST_Disjoint(ST_Transform(%s,%d),%s)"; + static const char *strRectOtherSRIDTemplate = "ST_Intersects(ST_Transform(%s,%d),%s)"; char szSRID[32]; char* strTmp = NULL; @@ -2121,7 +2153,7 @@ { char* strSRID; char* strRectOtherSRID; - static const char *strRectOtherSRIDTemplate = "NOT ST_Disjoint(%s,%s)"; + static const char *strRectOtherSRIDTemplate = "ST_Intersects(%s,%s)"; char* strTmp = NULL; strSRID = msPostGISBuildSQLSRID(layer); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/mapquery.c new/mapserver-7.6.4/mapquery.c --- old/mapserver-7.6.3/mapquery.c 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/mapquery.c 2021-07-12 22:16:21.000000000 +0200 @@ -1617,7 +1617,7 @@ } /* next selection shape */ - if(lp->resultcache->numresults == 0) msLayerClose(lp); /* no need to keep the layer open */ + if(lp->resultcache == NULL || lp->resultcache->numresults == 0) msLayerClose(lp); /* no need to keep the layer open */ } /* next layer */ /* was anything found? */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/mapservutil.c new/mapserver-7.6.4/mapservutil.c --- old/mapserver-7.6.3/mapservutil.c 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/mapservutil.c 2021-07-12 22:16:21.000000000 +0200 @@ -1651,7 +1651,7 @@ if(numtokens == 2) { /* check the class index */ classindex = atoi(tokens[1]); - if(classindex >= GET_LAYER(mapserv->map, layerindex)->numclasses) { + if(classindex < 0 || classindex >= GET_LAYER(mapserv->map, layerindex)->numclasses) { msSetError(MS_WEBERR, "Icon class=%d not found in layer=%s.", "mapserv()", classindex, GET_LAYER(mapserv->map, layerindex)->name); status = MS_FAILURE; goto li_cleanup; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/mapshape.c new/mapserver-7.6.4/mapshape.c --- old/mapserver-7.6.3/mapshape.c 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/mapshape.c 2021-07-12 22:16:21.000000000 +0200 @@ -1726,11 +1726,18 @@ /* load some information about this shapefile */ msSHPGetInfo( shpfile->hSHP, &shpfile->numshapes, &shpfile->type); + + if( shpfile->numshapes < 0 || shpfile->numshapes > 256000000 ) { + msSetError(MS_SHPERR, "Corrupted .shp file : numshapes = %d.", + "msShapefileOpen()", shpfile->numshapes); + msSHPClose(shpfile->hSHP); + return -1; + } + msSHPReadBounds( shpfile->hSHP, -1, &(shpfile->bounds)); bufferSize = strlen(filename)+5; dbfFilename = (char *)msSmallMalloc(bufferSize); - dbfFilename[0] = '\0'; strcpy(dbfFilename, filename); /* clean off any extention the filename might have */ @@ -1749,6 +1756,7 @@ if( log_failures ) msSetError(MS_IOERR, "(%s)", "msShapefileOpen()", dbfFilename); free(dbfFilename); + msSHPClose(shpfile->hSHP); return(-1); } free(dbfFilename); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/mapxbase.c new/mapserver-7.6.4/mapxbase.c --- old/mapserver-7.6.3/mapxbase.c 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/mapxbase.c 2021-07-12 22:16:21.000000000 +0200 @@ -192,6 +192,7 @@ pabyBuf = (uchar *) msSmallMalloc(500); if( VSIFReadL( pabyBuf, 32, 1, psDBF->fp ) != 1 ) { + VSIFCloseL( psDBF->fp ); msFree(psDBF); msFree(pabyBuf); return( NULL ); @@ -203,6 +204,13 @@ psDBF->nHeaderLength = nHeadLen = pabyBuf[8] + pabyBuf[9]*256; psDBF->nRecordLength = nRecLen = pabyBuf[10] + pabyBuf[11]*256; + if (nHeadLen <= 32) { + VSIFCloseL( psDBF->fp ); + msFree(psDBF); + msFree(pabyBuf); + return( NULL ); + } + psDBF->nFields = nFields = (nHeadLen - 32) / 32; psDBF->pszCurrentRecord = (char *) msSmallMalloc(nRecLen); @@ -217,6 +225,7 @@ if( VSIFReadL( pabyBuf, nHeadLen - 32, 1, psDBF->fp ) != 1 ) { msFree(psDBF->pszCurrentRecord); + VSIFCloseL( psDBF->fp ); msFree(psDBF); msFree(pabyBuf); return( NULL ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mapserver-7.6.3/textlayout.c new/mapserver-7.6.4/textlayout.c --- old/mapserver-7.6.3/textlayout.c 2021-04-30 23:26:25.000000000 +0200 +++ new/mapserver-7.6.4/textlayout.c 2021-07-12 22:16:21.000000000 +0200 @@ -214,7 +214,7 @@ } #endif -int WARN_UNUSED check_single_font(fontSetObj *fontset, char *fontkey, text_run *run, TextInfo *glyphs, int ignore_missing) { +static int check_single_font(fontSetObj *fontset, char *fontkey, text_run *run, TextInfo *glyphs, int ignore_missing) { int i; face_element *fcache = NULL; if(fontset && fontkey) { @@ -228,16 +228,23 @@ run->face = fcache; if(UNLIKELY(!fcache)) return MS_FAILURE; for(i=0; i<run->length; i++) { - int codepoint = msGetGlyphIndex(fcache, glyphs->unicodes[run->offset+i]); + unsigned int codepoint = msGetGlyphIndex(fcache, glyphs->unicodes[run->offset+i]); if(codepoint || ignore_missing) + { + if( codepoint == 0 ) + { + msDebug("Unable to find glyph for codepoint %u. Using ? as fallback.\n", glyphs->unicodes[run->offset+i]); + codepoint = msGetGlyphIndex(fcache, '?'); + } glyphs->codepoints[run->offset+i] = codepoint; + } else return MS_FAILURE; } return MS_SUCCESS; } -int WARN_UNUSED get_face_for_run(fontSetObj *fontset, char *fontlist, text_run *run, TextInfo *glyphs) { +static int get_face_for_run(fontSetObj *fontset, char *fontlist, text_run *run, TextInfo *glyphs) { char *startfont, *endfont; int ok; #if defined(USE_HARFBUZZ) && defined(USE_FRIBIDI)
