Skip to content

protocol.h: fix the CURLPROTO_MASK - #21031

Closed
bagder wants to merge 2 commits into
masterfrom
bagder/proto-mask
Closed

bagder wants to merge 2 commits into
masterfrom
bagder/proto-mask

Conversation

@bagder

@bagder bagder commented Mar 20, 2026

Copy link
Copy Markdown
Member

It had an 'f' too few

Follow-up to cd5ca80

Spotted by Codex Security

Test case 3219 added to catch this next time.

It had an 'f' too few

Follow-up to cd5ca80

Spotted by Codex Security

Test case 3219 added to catch this next time.
@github-actions github-actions Bot added the tests label Mar 20, 2026
@bagder
bagder marked this pull request as ready for review March 20, 2026 13:07
@bagder bagder changed the title protcol.h: fix the CURLPROTO_MASK protocol.h: fix the CURLPROTO_MASK Mar 20, 2026
@bagder
bagder requested a review from Copilot March 20, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an incorrect CURLPROTO_MASK value in lib/protocol.h (missing one hex f) and adds a unit test to prevent regressions, as a follow-up to the earlier change referenced in the PR description.

Changes:

  • Correct CURLPROTO_MASK from 0x3ffffff to 0x3fffffff to include all public protocol bits up to CURLPROTO_GOPHERS (bit 29).
  • Add unit test unit3219 plus the corresponding test spec test3219.
  • Wire the new test into the unit and data test makefiles.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/protocol.h Fixes the protocol bitmask to include all intended public protocol bits.
tests/unit/unit3219.c Adds assertions validating mask inclusion/exclusion for key protocol bits.
tests/unit/Makefile.inc Registers the new unit test source in the unit test bundle.
tests/data/test3219 Adds the test case definition for the new unit test.
tests/data/Makefile.am Includes test3219 in the autotools test case list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/data/test3219 Resolved
Comment thread tests/unit/unit3219.c Resolved
@bagder

bagder commented Mar 20, 2026

Copy link
Copy Markdown
Member Author

For the record, I think this is overzealous:


tests/unit/unit1627.c: line 89: '}' preceded by empty line

@bagder bagder closed this in f2ba8f0 Mar 20, 2026
@bagder
bagder deleted the bagder/proto-mask branch March 20, 2026 16:24
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
It had an 'f' too few. Also provide CURLPROTO_WS* unconditionally
internally, so that code can depend on them in all builds.

Follow-up to cd5ca80

Spotted by Codex Security

Test case 3219 added to catch this next time.

Closes curl#21031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants