Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9cc3665
build: use glob-tree-ex for test source discovery in Jamfile
alandefreitas Feb 25, 2026
592fec0
test: public interface boundary and fuzz tests
alandefreitas Feb 27, 2026
f0a80ad
fix: encode() UB pointer arithmetic for small buffers
alandefreitas Feb 27, 2026
af227d4
fix: url_base loop condition order
alandefreitas Feb 27, 2026
61c8962
fix: LLONG_MIN negation UB in format
alandefreitas Feb 27, 2026
bcd76d8
fix: ci_less::operator() return type
alandefreitas Feb 27, 2026
fc51e83
fix: incorrect noexcept in segments_base::front() and back()
alandefreitas Feb 27, 2026
f4f723e
fix: recycled_ptr::get() nullptr when empty
alandefreitas Feb 27, 2026
217c954
fix: format center-alignment padding
alandefreitas Feb 27, 2026
f1d59ab
fix: decode_view::ends_with with empty string
alandefreitas Feb 27, 2026
1c6e27d
fix: stale pattern n.path after colon-encoding
alandefreitas Feb 27, 2026
ce4755d
fix: ci_is_less OOB read
alandefreitas Feb 27, 2026
87fb9cf
fix: recycled_ptr copy self-assignment
alandefreitas Feb 28, 2026
080a11a
fix: url move self-assignment
alandefreitas Feb 27, 2026
b4ec9f4
fix: encode_one signed char right-shift
alandefreitas Feb 27, 2026
8a6fd2f
fix: encode() noexcept on throwing template
alandefreitas Feb 27, 2026
0b2bf1a
fix: port_rule has_number for port zero at end of input
alandefreitas Feb 27, 2026
1f2ccb4
fix: ci_equal arguments by const reference
alandefreitas Feb 27, 2026
f87da97
fix: decode() noexcept on throwing template
alandefreitas Feb 27, 2026
61a597d
docs: error_types copy-paste deprecation messages
alandefreitas Feb 27, 2026
2b81110
fix: remove broken coveralls upload from Drone CI
alandefreitas Mar 2, 2026
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
15 changes: 0 additions & 15 deletions .drone/drone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,21 +205,6 @@ elif [ "$DRONE_JOB_BUILDTYPE" == "codecov" ]; then
cd "$BOOST_ROOT/libs/$SELF"
ci/travis/codecov.sh

# coveralls
# uses multiple lcov steps from boost-ci codecov.sh script
if [ -n "${COVERALLS_REPO_TOKEN}" ]; then
echo "processing coveralls"
pip3 install --user cpp-coveralls
cd "$BOOST_CI_SRC_FOLDER"

export PATH=/tmp/lcov/bin:$PATH
command -v lcov
lcov --version

lcov --remove coverage.info -o coverage_filtered.info '*/test/*' '*/extra/*'
cpp-coveralls --verbose -l coverage_filtered.info
fi

elif [ "$DRONE_JOB_BUILDTYPE" == "valgrind" ]; then

echo '==================================> INSTALL'
Expand Down
2 changes: 1 addition & 1 deletion include/boost/url/decode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ system::result<typename StringToken::result_type>
decode(
core::string_view s,
encoding_opts opt = {},
StringToken&& token = {}) noexcept;
StringToken&& token = {});

} // urls
} // boost
Expand Down
5 changes: 3 additions & 2 deletions include/boost/url/detail/impl/format_args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ encode_one(
return;
}
*out++ = '%';
*out++ = urls::detail::hexdigs[0][c>>4];
*out++ = urls::detail::hexdigs[0][c&0xf];
auto uc = static_cast<unsigned char>(c);
*out++ = urls::detail::hexdigs[0][uc>>4];
*out++ = urls::detail::hexdigs[0][uc&0xf];
}

// get an unsigned value from format_args
Expand Down
2 changes: 1 addition & 1 deletion include/boost/url/encode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ encode(
core::string_view s,
CS const& allowed,
encoding_opts opt = {},
StringToken&& token = {}) noexcept;
StringToken&& token = {});

} // urls
} // boost
Expand Down
6 changes: 3 additions & 3 deletions include/boost/url/error_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ using system_error

@warning This alias is no longer supported and
should not be used in new code. Please use
`core::string_view` instead.
`system::generic_category` instead.

This alias is included for backwards
compatibility with earlier versions of the
Expand All @@ -134,7 +134,7 @@ using boost::system::generic_category;

@warning This alias is no longer supported and
should not be used in new code. Please use
`core::string_view` instead.
`system::system_category` instead.

This alias is included for backwards
compatibility with earlier versions of the
Expand All @@ -154,7 +154,7 @@ using boost::system::system_category;

@warning This alias is no longer supported and
should not be used in new code. Please use
`core::string_view` instead.
`system::errc` instead.

This alias is included for backwards
compatibility with earlier versions of the
Expand Down
6 changes: 3 additions & 3 deletions include/boost/url/grammar/ci_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ struct ci_equal
class String0, class String1>
bool
operator()(
String0 s0,
String1 s1) const noexcept
String0 const& s0,
String1 const& s1) const noexcept
{
return ci_is_equal(s0, s1);
}
Expand Down Expand Up @@ -330,7 +330,7 @@ struct ci_less
{
using is_transparent = void;

std::size_t
bool
operator()(
core::string_view s0,
core::string_view s1) const noexcept
Expand Down
2 changes: 2 additions & 0 deletions include/boost/url/grammar/impl/recycled.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ operator=(
recycled_ptr const& other) noexcept ->
recycled_ptr&
{
if(this == &other)
return *this;
BOOST_ASSERT(
bin_ == other.bin_);
if(p_)
Expand Down
2 changes: 1 addition & 1 deletion include/boost/url/grammar/recycled.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class recycled_ptr
*/
T* get() const noexcept
{
return &p_->t;
return p_ ? &p_->t : nullptr;
}

/** Return the referenced object
Expand Down
2 changes: 1 addition & 1 deletion include/boost/url/impl/decode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ system::result<typename StringToken::result_type>
decode(
core::string_view s,
encoding_opts opt,
StringToken&& token) noexcept
StringToken&& token)
{
static_assert(
string_token::is_token<
Expand Down
7 changes: 3 additions & 4 deletions include/boost/url/impl/encode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ encode(
auto const end = dest + size;
auto const last = it + s.size();
auto const dest0 = dest;
auto const end3 = end - 3;

if (!opt.space_as_plus)
{
Expand All @@ -147,7 +146,7 @@ encode(
++it;
continue;
}
if (dest > end3)
if (end - dest < 3)
return dest - dest0;
encode(dest, c);
++it;
Expand Down Expand Up @@ -177,7 +176,7 @@ encode(
++it;
continue;
}
if(dest > end3)
if(end - dest < 3)
return dest - dest0;
encode(dest, c);
++it;
Expand Down Expand Up @@ -279,7 +278,7 @@ encode(
core::string_view s,
CS const& allowed,
encoding_opts opt,
StringToken&& token) noexcept
StringToken&& token)
{
BOOST_CORE_STATIC_ASSERT(
grammar::is_charset<CS>::value);
Expand Down
4 changes: 2 additions & 2 deletions include/boost/url/impl/segments_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ size() const noexcept
inline
std::string
segments_base::
front() const noexcept
front() const
{
BOOST_ASSERT(! empty());
return *begin();
Expand All @@ -189,7 +189,7 @@ front() const noexcept
inline
std::string
segments_base::
back() const noexcept
back() const
{
BOOST_ASSERT(! empty());
return *--end();
Expand Down
2 changes: 2 additions & 0 deletions include/boost/url/impl/url.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ url&
url::
operator=(url&& u) noexcept
{
if(this == &u)
return *this;
if(s_)
deallocate(s_);
impl_ = u.impl_;
Expand Down
12 changes: 7 additions & 5 deletions include/boost/url/impl/url_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ remove_scheme()
auto begin = s_ + impl_.offset(id_path);
auto it = begin;
auto end = begin + pn;
while (*it != '/' &&
it != end)
while (it != end &&
*it != '/')
++it;
// we don't need op here because this is
// an internal operation
Expand Down Expand Up @@ -2089,8 +2089,8 @@ normalize_path()
auto end = begin + pn;
while (core::string_view(it, 2) == "./")
it += 2;
while (*it != '/' &&
it != end)
while (it != end &&
*it != '/')
++it;
// we don't need op here because this is
// an internal operation
Expand Down Expand Up @@ -2614,8 +2614,10 @@ first_segment() const noexcept
p0, end - p0);
auto p = p0;
while(*p != '/')
{
BOOST_ASSERT(p < end);
++p;
BOOST_ASSERT(p < end);
}
return core::string_view(p0, p - p0);
}

Expand Down
2 changes: 1 addition & 1 deletion include/boost/url/rfc/detail/impl/port_rule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ parse(
}
// no digits
t.str = core::string_view(start, it);
t.has_number = it != end;
t.has_number = it != start;
t.number = 0;
return t;
}
Expand Down
4 changes: 2 additions & 2 deletions include/boost/url/segments_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class BOOST_SYMBOL_VISIBLE segments_base
@return The first segment.
*/
std::string
front() const noexcept;
front() const;

/** Return the last segment

Expand Down Expand Up @@ -277,7 +277,7 @@ class BOOST_SYMBOL_VISIBLE segments_base
@return The last segment.
*/
std::string
back() const noexcept;
back() const;

/** Return an iterator to the beginning

Expand Down
2 changes: 2 additions & 0 deletions src/decode_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ bool
decode_view::
ends_with( core::string_view s ) const noexcept
{
if (s.empty())
return true;
if (s.size() > size())
return false;
auto it0 = end();
Expand Down
48 changes: 25 additions & 23 deletions src/detail/format_args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ format(core::string_view str, format_context& ctx, grammar::lut_chars const& cs)
lpad = pad;
break;
case '^':
lpad = w / 2;
lpad = pad / 2;
rpad = pad - lpad;
break;
}
Expand Down Expand Up @@ -364,21 +364,24 @@ measure(
{
dn += measure_one('-', cs);
++n;
v *= -1;
}
else if (sign != '-')
{
dn += measure_one(sign, cs);
++n;
}
// Use unsigned to avoid UB when v == LLONG_MIN
unsigned long long int uv = v < 0
? 0ull - static_cast<unsigned long long int>(v)
: static_cast<unsigned long long int>(v);
do
{
int d = v % 10;
v /= 10;
int d = static_cast<int>(uv % 10);
uv /= 10;
dn += measure_one('0' + static_cast<char>(d), cs);
++n;
}
while (v > 0);
while (uv > 0);

std::size_t w = width;
if (width_idx != std::size_t(-1) ||
Expand Down Expand Up @@ -445,29 +448,29 @@ format(
grammar::lut_chars const& cs) const
{
// get n digits
long long int v0 = v;
long long int p = 1;
// Use unsigned to avoid UB when v == LLONG_MIN
bool const neg = v < 0;
unsigned long long int uv = neg
? 0ull - static_cast<unsigned long long int>(v)
: static_cast<unsigned long long int>(v);
unsigned long long int uv0 = uv;
unsigned long long int p = 1;
std::size_t n = 0;
if (v < 0)
{
v *= - 1;
++n;
}
else if (sign != '-')
if (neg || sign != '-')
{
++n;
}
do
{
if (v >= 10)
if (uv >= 10)
p *= 10;
v /= 10;
uv /= 10;
++n;
}
while (v > 0);
while (uv > 0);
static constexpr auto m =
std::numeric_limits<long long int>::digits10;
BOOST_ASSERT(n <= m + 1);
BOOST_ASSERT(n <= m + 2);
ignore_unused(m);

// get pad
Expand Down Expand Up @@ -506,17 +509,16 @@ format(
}

// write
v = v0;
uv = uv0;
char* out = ctx.out();
if (!zeros)
{
for (std::size_t i = 0; i < lpad; ++i)
encode_one(out, fill, cs);
}
if (v < 0)
if (neg)
{
encode_one(out, '-', cs);
v *= -1;
--n;
}
else if (sign != '-')
Expand All @@ -531,10 +533,10 @@ format(
}
while (n)
{
unsigned long long int d = v / p;
unsigned long long int d = uv / p;
encode_one(out, '0' + static_cast<char>(d), cs);
--n;
v %= p;
uv %= p;
p /= 10;
}
if (!zeros)
Expand Down Expand Up @@ -570,7 +572,7 @@ grammar::lut_chars const& cs) const
while (v > 0);
static constexpr auto m =
std::numeric_limits<unsigned long long int>::digits10;
BOOST_ASSERT(n <= m + 1);
BOOST_ASSERT(n <= m + 2);
ignore_unused(m);

// get pad
Expand Down
1 change: 1 addition & 0 deletions src/detail/pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ apply(
dest0++;
}
}
n.path += diff;
}
}
// 2) url has no authority and path
Expand Down
Loading
Loading