From fa2de5747e76f32283fec9460b4f4277333c18c1 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 29 May 2026 22:09:16 +0200 Subject: [PATCH 1/2] Pin MEOS with the wasm pg_config SIZEOF_LONG_LONG fix Adds the SIZEOF_LONG_LONG emission to the rendered pg_config.h so the DuckDB-Wasm (wasm32-emscripten / ILP32) build of MEOS no longer fails the pg_bitutils integer-width check. --- vcpkg_ports/meos/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcpkg_ports/meos/portfile.cmake b/vcpkg_ports/meos/portfile.cmake index 82619e3a..9aeff5d5 100644 --- a/vcpkg_ports/meos/portfile.cmake +++ b/vcpkg_ports/meos/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO estebanzimanyi/MobilityDB - REF a8178dc9d56d841d0eb5025a7e8717c8d25a1d0f - SHA512 030a144bb3247695702dd2de11f4c389ed28c6eb0186e6988a489e2b00e9801179ba8f27bcbcd81ae89e398a7277ed7f9ff7058dbf15f5db322ae4644365c560 + REF 3db47f887c61f049a6a03db55c48bedf6d10eee4 + SHA512 b73123bca036813c43937f90f0d0ce45af5cb9e39d6a597304199d21ae854212319a3a7b58ecd075eb5678d89d6d5990b9faf63dd29bd8c9a4e2ed83282b94c5 ) vcpkg_replace_string( From b4bf00fe30b858db3c66a5a98fe8631680473739 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Wed, 27 May 2026 16:52:57 +0200 Subject: [PATCH 2/2] Fix stboxFromHexWKB reading past the input buffer (#170) Stbox_from_hexwkb passed the DuckDB string_t::GetData() pointer straight to the MEOS stbox_from_hexwkb(), which derives the length itself with strlen(). A string_t payload is not NUL-terminated, so strlen() ran past the buffer: on allocators that leave the trailing byte non-zero (macOS arm64) it walked into adjacent heap and reported a spurious odd-length "Invalid hex string, length (N)" intermittently, while glibc's zeroed tail hid it elsewhere. Copy the input into a NUL-terminated std::string before the call, matching every other *FromHexWKB consumer. This removes the intermittent osx_arm64 failure that #170 worked around by excluding the architecture. --- src/geo/stbox_functions.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/geo/stbox_functions.cpp b/src/geo/stbox_functions.cpp index b5398f02..55b817ce 100644 --- a/src/geo/stbox_functions.cpp +++ b/src/geo/stbox_functions.cpp @@ -191,8 +191,13 @@ void StboxFunctions::Stbox_from_hexwkb(DataChunk &args, ExpressionState &state, UnaryExecutor::Execute( args.data[0], result, args.size(), [&](string_t input_hexwkb) -> string_t { - char *hexwkb = (char*)input_hexwkb.GetData(); - STBox *stbox = stbox_from_hexwkb(hexwkb); + // string_t::GetData() is not NUL-terminated, but stbox_from_hexwkb() + // strlen()s its argument; reading the raw pointer overruns the buffer + // on allocators that leave the trailing byte non-zero (macOS arm64), + // yielding a spurious "Invalid hex string, length (...)" (#170). Copy + // into a NUL-terminated std::string first, as the sibling consumers do. + std::string hexwkb = input_hexwkb.GetString(); + STBox *stbox = stbox_from_hexwkb(hexwkb.c_str()); if (!stbox) { throw InternalException("Failure in Stbox_from_hexwkb: unable to cast hexwkb to stbox"); return string_t();