Skip to content

Commit 1d078e3

Browse files
committed
GH-47655: [C++][Parquet][CI] Fix failure to generate seed corpus
On OSS-Fuzz, generating the Parquet seed corpus would trigger a multiplication overflow.
1 parent 9a21925 commit 1d078e3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cpp/src/parquet/arrow/generate_fuzz_corpus.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,13 @@ Result<std::shared_ptr<RecordBatch>> ExampleBatch1() {
147147
{name_gen(), gen.Decimal32(decimal32(7, 3), kBatchSize, kNullProbability)});
148148

149149
// Timestamp
150+
// (Parquet doesn't have seconds timestamps so the values are going to be
151+
// multiplied by 10)
152+
auto int64_timestamps_array =
153+
gen.Int64(kBatchSize, -9000000000000000LL, 9000000000000000LL, kNullProbability);
150154
for (auto unit : TimeUnit::values()) {
151-
ARROW_ASSIGN_OR_RAISE(auto timestamps, int64_array->View(timestamp(unit, "UTC")));
155+
ARROW_ASSIGN_OR_RAISE(auto timestamps,
156+
int64_timestamps_array->View(timestamp(unit, "UTC")));
152157
columns.push_back({name_gen(), timestamps});
153158
}
154159
// Time32, time64

0 commit comments

Comments
 (0)