sendf: accept zero-length data in Curl_client_write()#7898
Closed
monnerat wants to merge 1 commit into
Closed
Conversation
Member
|
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. |
Contributor
Author
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: |
Member
|
ok |
Member
|
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.
monnerat
force-pushed
the
openldap-zero-length
branch
from
October 25, 2021 12:16
411a2b4 to
b75351c
Compare
Contributor
Author
|
Commit replaced. PR conversion done. |
bagder
approved these changes
Oct 25, 2021
jay
approved these changes
Oct 25, 2021
Member
|
Thanks! |
Contributor
Author
|
Thanks for pulling. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).