Copilot commented on code in PR #49813:
URL: https://github.com/apache/arrow/pull/49813#discussion_r3223318824


##########
cpp/src/gandiva/gdv_string_function_stubs.cc:
##########
@@ -579,15 +623,24 @@ const char* translate_utf8_utf8_utf8(int64_t context, 
const char* in, int32_t in
     return in;
   }

Review Comment:
   `translate_utf8_utf8_utf8` treats `from_len <= 0` as a no-op and returns the 
original input. This also silently accepts negative `from_len` (and `to_len` 
later behaves as if it were 0), which is inconsistent with the new 
negative-length validation added to other string functions and can produce 
incorrect results for invalid inputs. Please explicitly reject negative 
`from_len`/`to_len` (set an error message, `*out_len = 0`, and return "").



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