From b008a04dbbbec9aba37fc6f71a7e273e86efac69 Mon Sep 17 00:00:00 2001 From: jmestwa-coder Date: Mon, 25 May 2026 21:22:47 +0530 Subject: [PATCH] avoid 32-bit size overflow in WKBBuffer::ReadCoords bounds check --- cpp/src/parquet/geospatial/util_internal.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/parquet/geospatial/util_internal.cc b/cpp/src/parquet/geospatial/util_internal.cc index 59551ae87035..25a709306af5 100644 --- a/cpp/src/parquet/geospatial/util_internal.cc +++ b/cpp/src/parquet/geospatial/util_internal.cc @@ -64,7 +64,7 @@ class WKBBuffer { template void ReadCoords(uint32_t n_coords, bool swap, Visit&& visit) { - size_t total_bytes = n_coords * sizeof(Coord); + uint64_t total_bytes = static_cast(n_coords) * sizeof(Coord); if (size_ < total_bytes) { throw ParquetException("Can't read coordinate sequence of ", total_bytes, " bytes from WKBBuffer with ", size_, " remaining");