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 2022/01/19 10:12:00 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #12182: ARROW-15360: [Python] Check slice bounds in Buffer.slice()

pitrou commented on a change in pull request #12182:
URL: https://github.com/apache/arrow/pull/12182#discussion_r787579723



##########
File path: python/pyarrow/io.pxi
##########
@@ -1056,10 +1056,10 @@ cdef class Buffer(_Weakrefable):
             raise IndexError('Offset must be non-negative')
 
         if length is None:
-            result = SliceBuffer(self.buffer, offset)
+            result = GetResultValue(SliceBufferSafe(self.buffer, offset))
         else:
-            result = SliceBuffer(self.buffer, offset, max(length, 0))
-
+            result = GetResultValue(SliceBufferSafe(self.buffer, offset,
+                                                    max(length, 0)))

Review comment:
       Right, it would probably be a good idea to change this. I'll give it a try.




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