zeroshade commented on code in PR #1618:
URL: https://github.com/apache/arrow-go/pull/1618#discussion_r4620975312


##########
arrow/array/string.go:
##########
@@ -229,6 +230,9 @@ func (a *String) ValidateFull() error {
                        return fmt.Errorf("arrow/array: string offsets are not 
monotonically non-decreasing at index %d: %d < %d",
                                a.data.offset+i, offsets[i], offsets[i-1])
                }
+               if int(offsets[i]) > len(a.values) {
+                       return fmt.Errorf("arrow/array: string offset %d out of 
bounds of data buffer (length %d)", offsets[i], len(a.values))

Review Comment:
   Nit, optional: unlike the other `ValidateFull` errors (such as "not 
monotonically non-decreasing at index %d"), this one doesn't say which slot is 
bad. Reusing `Validate`'s wording makes sense, but adding the index 
(`a.data.offset+i`) would help find the bad offset in a large array. The same 
applies to the `LargeString` check below.



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