Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
matrix: ${{ steps.cpp-matrix.outputs.matrix }}
steps:
- name: Generate Test Matrix
uses: alandefreitas/cpp-actions/cpp-matrix@v1.8.10
uses: alandefreitas/cpp-actions/cpp-matrix@v1.9.0
id: cpp-matrix
with:
compilers: |
Expand Down Expand Up @@ -111,21 +111,21 @@ jobs:
uses: actions/checkout@v4

- name: Setup C++
uses: alandefreitas/cpp-actions/setup-cpp@v1.8.10
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.0
id: setup-cpp
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}

- name: Install packages
if: matrix.install != ''
uses: alandefreitas/cpp-actions/package-install@v1.8.10
uses: alandefreitas/cpp-actions/package-install@v1.9.0
id: package-install
with:
apt-get: ${{ matrix.install }}

- name: Clone Boost
uses: alandefreitas/cpp-actions/boost-clone@v1.8.10
uses: alandefreitas/cpp-actions/boost-clone@v1.9.0
id: boost-clone
with:
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
corpus-

- name: CMake Workflow
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.10
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0
if: matrix.is-no-factor-intermediary != 'true'
with:
source-dir: ../boost-root
Expand All @@ -226,7 +226,7 @@ jobs:
trace-commands: true

- name: CMake Integration Workflow
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.10
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0
if: matrix.is-no-factor-intermediary != 'true'
with:
source-dir: ../boost-root/libs/${{ steps.patch.outputs.module }}/test/cmake_test
Expand All @@ -244,7 +244,7 @@ jobs:
trace-commands: true

- name: CMake Root Workflow
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.10
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0
if: matrix.is-no-factor-intermediary != 'true'
with:
source-dir: .
Expand All @@ -263,7 +263,7 @@ jobs:
trace-commands: true

- name: B2 Workflow
uses: alandefreitas/cpp-actions/b2-workflow@v1.8.10
uses: alandefreitas/cpp-actions/b2-workflow@v1.9.0
env:
# Set flags via B2 options exclusively
CFLAGS: ''
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:
warnings-as-errors: true

- name: FlameGraph
uses: alandefreitas/cpp-actions/flamegraph@v1.8.10
uses: alandefreitas/cpp-actions/flamegraph@v1.9.0
if: matrix.time-trace
with:
source-dir: ../boost-root/libs/url
Expand Down Expand Up @@ -362,7 +362,7 @@ jobs:
fetch-depth: 100

- name: Changelog
uses: alandefreitas/cpp-actions/create-changelog@v1.8.10
uses: alandefreitas/cpp-actions/create-changelog@v1.9.0
with:
thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -385,15 +385,15 @@ jobs:
shell: bash
steps:
- name: Install packages
uses: alandefreitas/cpp-actions/package-install@v1.8.10
uses: alandefreitas/cpp-actions/package-install@v1.9.0
with:
apt-get: git cmake

- name: Clone Boost.URL
uses: actions/checkout@v4

- name: Clone Boost
uses: alandefreitas/cpp-actions/boost-clone@v1.8.10
uses: alandefreitas/cpp-actions/boost-clone@v1.9.0
id: boost-clone
with:
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
Expand Down
9 changes: 7 additions & 2 deletions src/parse_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ parse_query(core::string_view s) noexcept
// present query in URL (e.g. "http:?")
// which produces {{"", none}}.
if(s.empty())
{
// default-constructed string_view can return a null data pointer;
// query_ref expects a valid pointer even when the buffer is empty.
auto const* data = s.data();
core::string_view empty(data ? data : "", 0);
return params_encoded_view(
detail::query_ref(
s.data(), 0, 0));
empty, 0, 0));
}
auto rv = grammar::parse(s, query_rule);
if(! rv)
return rv.error();
Expand All @@ -40,4 +46,3 @@ parse_query(core::string_view s) noexcept

} // urls
} // boost

9 changes: 9 additions & 0 deletions test/unit/parse_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ struct parse_query_test
++it;
BOOST_TEST( it == params.end() );
}

// issue #946: default-constructed string_view has null data
{
core::string_view view;
auto rv = parse_query(view);
BOOST_TEST(rv);
BOOST_TEST(rv->empty());
BOOST_TEST(rv->begin() == rv->end());
}
}

void
Expand Down
Loading