Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-7934 : [C++] Fix UriEscape for empty string #6486

Closed
wants to merge 2 commits into from

Conversation

projjal
Copy link
Contributor

@projjal projjal commented Feb 25, 2020

No description provided.

@projjal
Copy link
Contributor Author

projjal commented Feb 25, 2020

@ursabot crossbow submit -g gandiva

@ursabot
Copy link

ursabot commented Feb 25, 2020

AMD64 Conda Crossbow Submit (#92476) builder has been succeeded.

Revision: b094c92

Submitted crossbow builds: ursa-labs/crossbow @ ursabot-538

Task Status
gandiva-jar-osx TravisCI
gandiva-jar-trusty TravisCI

@github-actions
Copy link

Copy link
Contributor Author

@projjal projjal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fix the nightly gandiva-linux failure where arrow-uri test for UriEscape with empty string is failing. When s is empty, the local variable escaped and s both point to the same address, for the library implementation that is being used in the docker image in the build, thereby creating problems.

Copy link
Member

@bkietz bkietz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test which fails without this change, or at least link to documentation indicating uriEscapeExA cannot accept an empty string.

@projjal
Copy link
Contributor Author

projjal commented Feb 25, 2020

Please add a test which fails without this change, or at least link to documentation indicating uriEscapeExA cannot accept an empty string.

There is already a test with empty string (

ASSERT_EQ(UriEscape(""), "");
). But it passes generally but fails only in the gandiva-trusty nightly build (https://travis-ci.org/ursa-labs/crossbow/builds/654801307) which runs inside a centos image with devtoolset 2

uriEscapeExA return NULL if both input and output pointers are same

if ((out == NULL) || (inFirst == out)) {

In the next line in uri.cc, string.resize is called with the null argument which causes the error.

@pitrou
Copy link
Member

pitrou commented Feb 25, 2020

Thanks for the explanation @projjal .

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants