Skip to content

Fix some slightly incorrect uses of checkprefix#6993

Closed
piru wants to merge 5 commits intocurl:masterfrom
piru:master
Closed

Fix some slightly incorrect uses of checkprefix#6993
piru wants to merge 5 commits intocurl:masterfrom
piru:master

Conversation

@piru
Copy link

@piru piru commented May 2, 2021

In various places checkprefix function is used in a way that can lead to potential forward compatibility issues. As an example if new authentication method "NTLM3" would be added, checkprefix("NTLM", auth) would incorrectly match it. Now either space, null char, or comma is required after the method value.

In addition fixed a bogus use of checkprefix function in Kerberos name_to_level function. The CURLOPT_KRBLEVEL API provided string was used as the prefix to check. It would kind of work if correct values were passed but would match incomplete strings as specific values. For example "c" would match to PROT_CLEAR. Using curl_strequal makes more sense here.

@bagder
Copy link
Member

bagder commented May 3, 2021

Thanks!

@bagder bagder closed this in b75620b May 3, 2021
bagder pushed a commit that referenced this pull request May 3, 2021
bagder pushed a commit that referenced this pull request May 3, 2021
bagder pushed a commit that referenced this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants