Skip to content

Unexpected behavior of curl_url_set for empty string (DEBUGASSERT) #11714

@ad0p

Description

@ad0p

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions