File tree Expand file tree Collapse file tree 6 files changed +15
-12
lines changed
config_generator/components/funcs
examples/api/bsoncxx/examples/bson_errors
src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/builder Expand file tree Collapse file tree 6 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 14
14
# Only LIBMONGOC_DOWNLOAD_VERSION needs to be updated when pinning to an unreleased commit.
15
15
# If pinning to an unreleased commit, create a "Blocked" JIRA ticket with
16
16
# a "depends on" link to the appropriate C Driver version release ticket.
17
- MONGOC_VERSION_MINIMUM = '1.30.1'
17
+ MONGOC_VERSION_MINIMUM = '57bffac11fde38d1ce097bb22fb5322a6114d644' # CXX-3103: bump to 2.0.0 once released.
18
18
19
19
20
20
class InstallCDriver (Function ):
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ functions:
398
398
type : setup
399
399
params :
400
400
updates :
401
- - { key: mongoc_version_minimum, value: 1.30.1 }
401
+ - { key: mongoc_version_minimum, value: 57bffac11fde38d1ce097bb22fb5322a6114d644 }
402
402
- command : subprocess.exec
403
403
type : setup
404
404
params :
Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ tar xzf mongo-c-driver.tar.gz --directory "${mongoc_dir}" --strip-components=1
40
40
# C Driver needs VERSION_CURRENT to compute BUILD_VERSION.
41
41
if [[ -f " ${mongoc_dir} /VERSION_CURRENT" ]]; then
42
42
: # Use the existing VERSION_CURRENT bundled with the release tarball.
43
+
44
+ # CXX-3103: overwrite incompatible build versions to support the upcoming 2.0.0 release.
45
+ echo " 1.31.0-pre" > | " ${mongoc_dir} /VERSION_CURRENT"
43
46
else
44
47
# RegEx pattern to match SemVer strings. See https://semver.org/.
45
48
declare -r semver_regex=" ^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ set(LIBBSON_REQUIRED_ABI_VERSION 1.0)
54
54
55
55
# Also update etc/purls.txt.
56
56
set (LIBMONGOC_REQUIRED_VERSION 1.30.0 )
57
- set (LIBMONGOC_DOWNLOAD_VERSION 1.30.1 )
57
+ set (LIBMONGOC_DOWNLOAD_VERSION 57bffac11fde38d1ce097bb22fb5322a6114d644 )
58
58
set (LIBMONGOC_REQUIRED_ABI_VERSION 1.0 )
59
59
60
60
set (NEED_DOWNLOAD_C_DRIVER false )
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ namespace examples {
27
27
// Used to trigger builder append failure.
28
28
struct big_string {
29
29
// BSON_SIZE_MAX == 0x7FFFFFFF
30
- // Leave some room for CDRIVER-5732.
31
- std::size_t length{static_cast <std::size_t >(std::numeric_limits<std::int32_t >::max () - 32u )};
30
+ std::size_t length{static_cast <std::size_t >(std::numeric_limits<std::int32_t >::max ())};
32
31
33
32
// Allocate an UNINITIALIZED blob of data that will not be accessed due to length checks.
34
33
// Leaving memory unitialized (rather than zero-init) should hopefully avoid slow and expensive
Original file line number Diff line number Diff line change @@ -298,13 +298,14 @@ core& core::append(types::b_double const& value) {
298
298
299
299
core& core::append (types::b_string const & value) {
300
300
stdx::string_view key = _impl->next_key ();
301
-
302
- if (!bson_append_utf8 (
303
- _impl->back (),
304
- key.data (),
305
- static_cast <std::int32_t >(key.length ()),
306
- value.value .data (),
307
- static_cast <std::int32_t >(value.value .length ()))) {
301
+ std::size_t value_length = value.value .length ();
302
+
303
+ if (value_length > std::size_t {INT32_MAX} || !bson_append_utf8 (
304
+ _impl->back (),
305
+ key.data (),
306
+ static_cast <std::int32_t >(key.length ()),
307
+ value.value .data (),
308
+ static_cast <std::int32_t >(value_length))) {
308
309
throw bsoncxx::v_noabi::exception{error_code::k_cannot_append_string};
309
310
}
310
311
You can’t perform that action at this time.
0 commit comments