You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "seebee-dev (via GitHub)" <gi...@apache.org> on 2026/04/15 09:22:05 UTC

[PR] GH-49752: [C++][Gandiva] Fix bugs in gdv_hash_using_openssl [arrow]

seebee-dev opened a new pull request, #49755:
URL: https://github.com/apache/arrow/pull/49755

   ### Rationale
   
   Fixes three bugs in `gdv_hash_using_openssl()` reported in #49752:
   
   1. **Unnecessary symbol export** — `gdv_hash_using_openssl()` is an internal helper called only by the public hash functions (`gdv_sha512_hash`, `gdv_sha256_hash`, `gdv_sha1_hash`, `gdv_md5_hash`). It should not be exported via `GANDIVA_EXPORT`.
   
   2. **Incorrect error condition** — The validity check after `EVP_DigestFinal_ex` used `&&`, requiring both `result_length != hash_digest_size` and `result_buf_size != (2 * hash_digest_size)` to be true before reporting an error. Either condition alone indicates a problem, so this should use `||`.
   
   3. **Wrong snprintf buffer size** — `snprintf` received the total buffer size instead of the remaining space (`result_buf_size - result_buff_index`), which could allow writing past the allocated region.
   
   ### What changes are included in this PR?
   
   - Removed `GANDIVA_EXPORT` from `gdv_hash_using_openssl` in both `hash_utils.h` and `hash_utils.cc`
   - Changed `&&` to `||` in the digest validation check
   - Corrected the `snprintf` size argument to use remaining buffer space
   
   ### Are these changes tested?
   
   Existing tests for `gdv_sha1_hash`, `gdv_sha256_hash`, `gdv_sha512_hash`, and `gdv_md5_hash` exercise `gdv_hash_using_openssl` through the public API. No test changes needed — the fixes correct error handling and symbol visibility without changing happy-path behavior.


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


Re: [PR] GH-49752: [C++][Gandiva] Fix bugs in gdv_hash_using_openssl [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #49755:
URL: https://github.com/apache/arrow/pull/49755#issuecomment-4251602818

   It seems that you used generative AI.
   Could you read https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code carefully.
   
   And could you use our PR template instead of removing it entirely?
   
   If you're ready, please reopen this PR.


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


Re: [PR] GH-49752: [C++][Gandiva] Fix bugs in gdv_hash_using_openssl [arrow]

Posted by "seebee-dev (via GitHub)" <gi...@apache.org>.
seebee-dev commented on PR #49755:
URL: https://github.com/apache/arrow/pull/49755#issuecomment-4252347797

   Sorry about that — I should have read the contribution guidelines more carefully before submitting. I've updated the PR to use the proper template and included AI disclosure as recommended.
   
   I used Claude to help identify the bug patterns and draft the fix, but I've reviewed the changes line by line and can walk through the reasoning for each. Happy to iterate on any feedback.


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


Re: [PR] GH-49752: [C++][Gandiva] Fix bugs in gdv_hash_using_openssl [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou closed pull request #49755: GH-49752: [C++][Gandiva] Fix bugs in gdv_hash_using_openssl
URL: https://github.com/apache/arrow/pull/49755


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