File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -776,6 +776,8 @@ class PlainByteArrayDecoder : public PlainDecoder<ByteArrayType> {
776776 // This precondition follows from those two checks.
777777 DCHECK_GE (len_, 4 );
778778 auto value_len = SafeLoadAs<int32_t >(data_);
779+ // `value_len <= estimated_data_length` is stricter than `value_len <= len_ - 4`
780+ // due to the way `estimated_data_length` is computed.
779781 if (ARROW_PREDICT_FALSE (value_len < 0 || value_len > estimated_data_length)) {
780782 return Status::Invalid (
781783 " Invalid or truncated PLAIN-encoded BYTE_ARRAY data" );
@@ -789,6 +791,7 @@ class PlainByteArrayDecoder : public PlainDecoder<ByteArrayType> {
789791 DCHECK_GE (estimated_data_length, 0 );
790792 }
791793 values_decoded += static_cast <int >(run_length);
794+ DCHECK_LE (values_decoded, num_values);
792795 return Status::OK ();
793796 } else {
794797 return helper->AppendNulls (run_length);
You can’t perform that action at this time.
0 commit comments