etseidl commented on code in PR #12340:
URL: https://github.com/apache/arrow-rs/pull/12340#discussion_r4644482540


##########
arrow-csv/src/reader/records.rs:
##########
@@ -84,8 +84,26 @@ impl RecordDecoder {
         }
 
         // Reserve sufficient capacity in offsets
-        self.offsets
-            .resize(self.offsets_len + to_read * self.num_columns, 0);
+        let offsets_capacity = to_read
+            .checked_mul(self.num_columns)

Review Comment:
   Just a FYI, I've been working on #12099 trying to prevent overruns without 
impacting performance. The code involved is _seriously_ sensitive to inlining, 
and at what level it's inlined. For some of these I think we'll need to discuss 
if the fix is worth it. In my case, I don't think there's a reported panic, 
just later errors thrown, or at worst wrong data, but this gets to Andrew's 
point in the Parquet security discussion. If a file is maliciously altered, 
what is the "correct" output?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to