taepper commented on code in PR #54939:
URL: https://github.com/apache/arrow/pull/54939#discussion_r4387386553
##########
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? Can we add a (non-fuzzing based) test for this directly?
##########
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()) {
Review Comment:
I think we can turn this into a
```
DCHECK_EQ(out_->child_data.size(), 1);
```
after `LoadList` succeeds without an error
--
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]