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 2021/09/23 20:26:40 UTC
[GitHub] [arrow] tachyonwill opened a new pull request #11222: ARROW-14109: Fix segfault when parsing JSON with duplicate keys.
tachyonwill opened a new pull request #11222:
URL: https://github.com/apache/arrow/pull/11222
When reading a JSON object with duplicate keys, Arrow can crash if the duplicate key was not in schema. In this case, the absent_fields_stack_ will not have an index to represent the duplicated key. When we encounter the duplicated key for a second time, field_index_ will be non-negative and greater than the size of absent_fields_stack_, thus triggering a crash when we attempt to read from absent_fields_stack_.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] commented on pull request #11222: ARROW-14109: Fix segfault when parsing JSON with duplicate keys.
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #11222:
URL: https://github.com/apache/arrow/pull/11222#issuecomment-926129268
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] cyb70289 commented on pull request #11222: ARROW-14109: [C++] Fix segfault when parsing JSON with duplicate keys.
Posted by GitBox <gi...@apache.org>.
cyb70289 commented on pull request #11222:
URL: https://github.com/apache/arrow/pull/11222#issuecomment-929738170
Thanks @tachyonwill !
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] cyb70289 closed pull request #11222: ARROW-14109: [C++] Fix segfault when parsing JSON with duplicate keys.
Posted by GitBox <gi...@apache.org>.
cyb70289 closed pull request #11222:
URL: https://github.com/apache/arrow/pull/11222
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] cyb70289 commented on a change in pull request #11222: ARROW-14109: [C++] Fix segfault when parsing JSON with duplicate keys.
Posted by GitBox <gi...@apache.org>.
cyb70289 commented on a change in pull request #11222:
URL: https://github.com/apache/arrow/pull/11222#discussion_r715312913
##########
File path: cpp/src/arrow/json/parser.cc
##########
@@ -753,7 +753,8 @@ class HandlerBase : public BlockParser,
if (ARROW_PREDICT_FALSE(field_index_ == -1)) {
return false;
}
- *duplicate_keys = !absent_fields_stack_[field_index_];
+ *duplicate_keys = field_index_ >= absent_fields_stack_.TopSize() ||
+ !absent_fields_stack_[field_index_];
Review comment:
Prefer more straightforward code (if else)?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] tachyonwill commented on a change in pull request #11222: ARROW-14109: [C++] Fix segfault when parsing JSON with duplicate keys.
Posted by GitBox <gi...@apache.org>.
tachyonwill commented on a change in pull request #11222:
URL: https://github.com/apache/arrow/pull/11222#discussion_r715795496
##########
File path: cpp/src/arrow/json/parser.cc
##########
@@ -753,7 +753,8 @@ class HandlerBase : public BlockParser,
if (ARROW_PREDICT_FALSE(field_index_ == -1)) {
return false;
}
- *duplicate_keys = !absent_fields_stack_[field_index_];
+ *duplicate_keys = field_index_ >= absent_fields_stack_.TopSize() ||
+ !absent_fields_stack_[field_index_];
Review comment:
Ok
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] cyb70289 closed pull request #11222: ARROW-14109: [C++] Fix segfault when parsing JSON with duplicate keys.
Posted by GitBox <gi...@apache.org>.
cyb70289 closed pull request #11222:
URL: https://github.com/apache/arrow/pull/11222
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] tachyonwill commented on pull request #11222: ARROW-14109: [C++] Fix segfault when parsing JSON with duplicate keys.
Posted by GitBox <gi...@apache.org>.
tachyonwill commented on pull request #11222:
URL: https://github.com/apache/arrow/pull/11222#issuecomment-929605289
What still needs to be done for this to get merged? Are we just waiting on @bkietz 's thoughts?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] cyb70289 commented on pull request #11222: ARROW-14109: [C++] Fix segfault when parsing JSON with duplicate keys.
Posted by GitBox <gi...@apache.org>.
cyb70289 commented on pull request #11222:
URL: https://github.com/apache/arrow/pull/11222#issuecomment-929738170
Thanks @tachyonwill !
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org