-
-
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
sendf: accept zero-length data in Curl_client_write() #7898
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you mean the assert(len) that was added in #6954. IMO it's easier to just return CURLE_OK on !len rather than check every time before we call it that it's not 0, but I'm fine either way.
I too would be fine with converting the assert to a plain check and return. I think the assert may have served it purpose by now. |
Yes, this is the cause of the abort.
Would you like I convert this PR to do it? In this case I would also be in favor of changing the next line: |
ok |
I'm fine with that as well! |
Historically, Curl_client_write() used a length value of 0 as a marker for a null-terminated data string. This feature has been removed in commit f4b85d2. To detect leftover uses of the feature, a DEBUGASSERT statement rejecting a length with value 0 was introduced, effectively precluding use of this function with zero-length data. The current commit removes the DEBUGASSERT and makes the function to return immediately if length is 0. A direct effect is to fix trying to output a zero-length distinguished name in openldap. Another DEBUGASSERT statement is also rephrased for better readability.
411a2b4
to
b75351c
Compare
Commit replaced. PR conversion done. |
Thanks! |
Thanks for pulling. |
As Curl_client_write() rejects zero-length output data, ldap root
requests resulting in a null distinguished name currently cause curl to
abort.
This commit explicitly checks for non zero-length DN before writing it
to LDIF output.
This is the first part of splitting PR #7199 (that still allows me to run CI).