zeroshade commented on code in PR #931:
URL: https://github.com/apache/arrow-go/pull/931#discussion_r3566723313
##########
arrow/cdata/cdata.go:
##########
@@ -468,6 +605,16 @@ func (imp *cimporter) doImportArr(src *CArrowArray) error {
// import is called recursively as needed for importing an array and its
children
// in order to generate array.Data objects
func (imp *cimporter) doImport() error {
+ if err := validateCArrayHeader(imp.arr); err != nil {
+ return err
+ }
+ if _, ok := imp.dt.(*arrow.DictionaryType); ok && imp.arr.dictionary ==
nil {
Review Comment:
Good — nil dictionary is handled here. Please add test coverage for this
path, plus a missing string/binary-view size-metadata buffer and at least one
wrong expected child/buffer count (struct/union/REE).
##########
arrow/cdata/cdata.go:
##########
@@ -699,6 +849,12 @@ func (imp *cimporter) importBinaryViewLike() (err error) {
}
if len(buffers) > 2 {
+ if imp.cbuffers[len(buffers)] == nil {
+ return errors.New("invalid data buffer sizes")
Review Comment:
Minor consistency: wrap this with `arrow.ErrInvalid` like the neighboring
errors (same for the `invalid buffer` error around line 1027) so callers can
classify malformed-input errors uniformly.
--
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]