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

Crash appending empty array to WebURL.formParams #140

Closed
adam-fowler opened this issue Apr 1, 2022 · 0 comments · Fixed by #142
Closed

Crash appending empty array to WebURL.formParams #140

adam-fowler opened this issue Apr 1, 2022 · 0 comments · Fixed by #142
Assignees

Comments

@adam-fowler
Copy link

The following code crashes

var url = WebURL("http://test.com")
let params: [(String, String)] = []
url?.formParams.append(contentsOf: params)

Line 868 is the offender

var bytesWritten = 0
if let separator = separator {
buffer[0] = separator.codePoint
bytesWritten += 1
}

@karwa karwa self-assigned this Apr 1, 2022
karwa added a commit that referenced this issue Apr 1, 2022
Also makes the logic a little bit clearer and adds tests for empty
key/value names.

Fixes: #140
karwa added a commit that referenced this issue Apr 1, 2022
Also makes the logic a little bit clearer and adds tests for empty
key/value names.

Fixes: #140
@karwa karwa closed this as completed in #142 Apr 1, 2022
karwa added a commit that referenced this issue Apr 1, 2022
Also makes the logic a little bit clearer and adds tests for empty
key/value names.

Fixes: #140
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 a pull request may close this issue.

2 participants