-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Unexpected behavior of curl_url_set for empty string (DEBUGASSERT) #11714
Labels
Comments
Setting a blank URL does not assert for me. It should return an error. #include <curl/curl.h>
int main(void)
{
curl_global_init(CURL_GLOBAL_ALL);
CURLU *u = curl_url();
curl_url_set(u, CURLUPART_URL, "", 0);
curl_global_cleanup();
} |
I apologize, I forgot to mention that we use curl_url_set with CURLU_DEFAULT_SCHEME option... you are right, without this flag, behavior is different. |
bagder
added a commit
that referenced
this issue
Aug 23, 2023
Test it in 1560 Fixes #11714 Reported-by: ad0p on github
#11715 now makes this return |
ptitSeb
pushed a commit
to wasix-org/curl
that referenced
this issue
Sep 25, 2023
Test it in 1560 Fixes curl#11714 Reported-by: ad0p on github Closes curl#11715
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I did this
I am trying to use curl_url_set with CURLU_DEFAULT_SCHEME option to validate a string and check whether it's a valid URL.
Now, our tests fail when calling curl_url_set on empty string with DEBUGBUILD.
It fails on urlapi.c:1245
DEBUGASSERT(pathlen < urllen);
With release build, it returns CURLUE_OK
Is it expected for empty string URL to fail here and just for DEBUGBUILD?
I expected the following
Release build says that empty string is a valid URL, debug build fails on assertion. I would expect the same behavior in both.
curl/libcurl version
curl 8.2.1
operating system
not relevant
The text was updated successfully, but these errors were encountered: