Skip to content

Commit

Permalink
Merge pull request #2932 from rouault/fix_2931
Browse files Browse the repository at this point in the history
PROJStringFormatter::toString(): avoid invalid iterator increment (fixes #2931)
  • Loading branch information
rouault authored Nov 9, 2021
2 parents fa0c0e6 + f7e9db5 commit c20b3f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ jobs:
runs-on: windows-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"

strategy:
fail-fast: false
matrix:
BUILD_TYPE: [Release, Debug]

env:
ARCH: x64
BUILD_SHARED_LIBS: ON
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}

steps:

Expand Down Expand Up @@ -42,7 +48,7 @@ jobs:
mkdir %PROJ_BUILD%
cd %PROJ_BUILD%
set PROJ_DIR=%GITHUB_WORKSPACE%\proj_dir
cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="{{ env.BUILD_SHARED_LIBS }}" -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX="%PROJ_DIR%"
cmake -GNinja .. -DCMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}" -DBUILD_SHARED_LIBS="${{ env.BUILD_SHARED_LIBS }}" -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX="%PROJ_DIR%"
ninja -v
ninja install
dir %PROJ_DIR%\bin
Expand All @@ -55,10 +61,10 @@ jobs:
set PROJ_DIR=%GITHUB_WORKSPACE%\proj_dir
set PROJ_BUILD=%GITHUB_WORKSPACE%\build
cd %PROJ_BUILD%
ctest -V -C Release
ctest -V -C "${{ env.BUILD_TYPE }}"
set PATH=%PROJ_DIR%\bin;%PATH%
call %GITHUB_WORKSPACE%\test\postinstall\test_cmake.bat %PROJ_DIR%
proj
if "${{ env.BUILD_TYPE }}"=="Release" call %GITHUB_WORKSPACE%\test\postinstall\test_cmake.bat %PROJ_DIR%
if "${{ env.BUILD_TYPE }}"=="Release" proj
MSYS2:
runs-on: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion src/iso19111/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7678,7 +7678,7 @@ const std::string &PROJStringFormatter::toString() const {
iterCur = steps.erase(iterPrev, std::next(iterCur));
if (iterCur != steps.begin())
iterCur = std::prev(iterCur);
if (iterCur == steps.begin())
if (iterCur == steps.begin() && iterCur != steps.end())
++iterCur;
};

Expand Down

0 comments on commit c20b3f6

Please sign in to comment.