You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/11/10 16:12:17 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #8626: ARROW-10545: [C++] Fix crash on invalid Parquet file (OSS-Fuzz)

pitrou commented on a change in pull request #8626:
URL: https://github.com/apache/arrow/pull/8626#discussion_r520685686



##########
File path: cpp/src/parquet/level_conversion.cc
##########
@@ -35,16 +36,17 @@ namespace internal {
 namespace {
 
 using ::arrow::internal::CpuInfo;
+using ::arrow::util::optional;
 
 template <typename OffsetType>
 void DefRepLevelsToListInfo(const int16_t* def_levels, const int16_t* rep_levels,
                             int64_t num_def_levels, LevelInfo level_info,
                             ValidityBitmapInputOutput* output, OffsetType* offsets) {
   OffsetType* orig_pos = offsets;
-  std::unique_ptr<::arrow::internal::FirstTimeBitmapWriter> valid_bits_writer;
+  optional<::arrow::internal::FirstTimeBitmapWriter> valid_bits_writer;
   if (output->valid_bits) {
-    valid_bits_writer.reset(new ::arrow::internal::FirstTimeBitmapWriter(
-        output->valid_bits, output->valid_bits_offset, num_def_levels));
+    valid_bits_writer.emplace(output->valid_bits, output->valid_bits_offset,
+                              output->values_read_upper_bound);

Review comment:
       The bitmap writer length was wrong here. @emkornfield 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org