shivendra-dev54 opened a new pull request, #888:
URL: https://github.com/apache/incubator-graphar/pull/888
### Reason for this PR
Fixes #881
`PathToDirectory` was crashing with a `std::out_of_range` exception when
parsing valid S3 URIs that do not contain a query string (`?`). This happens
because `find_last_of('?')` returns `std::string::npos`, which was being passed
directly into `path.substr()`.
### What changes are included in this PR?
Added an explicit check for `std::string::npos` in `PathToDirectory`. When
an S3 URI without a query string is processed, it now correctly identifies the
entire path as the prefix and sets the suffix to an empty string, safely
avoiding the out-of-bounds crash.
### Are these changes tested?
Yes, the C++ test suite was compiled and run locally, and all tests pass
successfully.
### Are there any user-facing changes?
No.
**Critical Fix: Fixes a bug that causes a crash (`std::out_of_range`
exception) when parsing valid S3 URIs without query strings.**
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]