pitrou commented on code in PR #54939:
URL: https://github.com/apache/arrow/pull/54939#discussion_r4410652799


##########
cpp/src/arrow/ipc/reader.cc:
##########
@@ -455,6 +456,21 @@ class ArrayLoader {
 
   Status Visit(const MapType& type) {
     RETURN_NOT_OK(LoadList(type));
+    if (!out_->child_data.empty()) {
+      // Ensure that GetNullCount() calls in MapArray::ValidateChildData
+      // don't access invalid memory.

Review Comment:
   > This is because when `null_count == -1`, it will be inferred from the 
unvalidated data?
   
   Yes.
   
   > Can we add a (non-fuzzing based) test for this directly?
   
   Well, for the test to be relevant, it would have to create invalid IPC data 
(a null bitmap that's too short, for example). Otherwise calling 
`GetNullCount()` would succeed anyway.



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