Skip to content

Commit 7d985a2

Browse files
authored
GH-46326: [C++][Parquet] Fix stack overflow in rapidjson value comparison to integer (#46327)
### Rationale for this change test-ubuntu-22.04-cpp-20 nightly is failing with a segfault in the ParquetGeoArrowCrsLonLat test. ### What changes are included in this PR? The integer comparison is updated to be more explicit such that it doesn't trigger the code path in rapidjson that results in unterminated recrusion. ### Are these changes tested? Yes ### Are there any user-facing changes? No! * GitHub Issue: #46326 Authored-by: Dewey Dunnington <dewey@wherobots.com> Signed-off-by: Dewey Dunnington <dewey@wherobots.com>
1 parent f270643 commit 7d985a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp/src/parquet/geospatial/util_json_internal.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ ::arrow::Result<std::string> GeospatialGeoArrowCrsToParquetCrs(
6161
return "";
6262
} else if (identifier["authority"] == "EPSG" && identifier["code"] == "4326") {
6363
return "";
64-
} else if (identifier["authority"] == "EPSG" && identifier["code"] == 4326) {
64+
} else if (identifier["authority"] == "EPSG" && identifier["code"].IsInt() &&
65+
identifier["code"].GetInt() == 4326) {
6566
return "";
6667
}
6768
}

0 commit comments

Comments
 (0)