Skip to content

setopt: move CURLOPT_CURLU - #21298

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/setopt-curlu
Closed

bagder wants to merge 1 commit into
masterfrom
bagder/setopt-curlu

Conversation

@bagder

@bagder bagder commented Apr 13, 2026

Copy link
Copy Markdown
Member

To fix cast from 'char *' to 'CURLU *' (aka 'struct Curl_URL *') increases required alignment from 1 to 8

Follow-up to 3407bee

To fix cast from 'char *' to 'CURLU *' (aka 'struct Curl_URL *')
increases required alignment from 1 to 8

Follow-up to 3407bee
@bagder
bagder marked this pull request as ready for review April 13, 2026 11:56
@bagder
bagder requested a review from Copilot April 13, 2026 11:56

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

This PR adjusts how CURLOPT_CURLU is routed and parsed inside Curl_vsetopt() so the option is read from the variadic argument list as a CURLU * (instead of as a char *), eliminating the problematic cast/alignment/UB scenario and keeping CURLOPT_CURLU consistent with other non-string pointer options.

Changes:

  • Move CURLOPT_CURLU handling from setopt_cptr() to setopt_pointers().
  • Update Curl_vsetopt() dispatch so CURLOPT_CURLU is handled via setopt_pointers() and read with va_arg(param, CURLU *).
  • Remove the old (CURLU *)ptr cast path.

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

@bagder bagder closed this in ec445fc Apr 13, 2026
@bagder
bagder deleted the bagder/setopt-curlu branch April 13, 2026 12:34
dkarpov1970 pushed a commit to dkarpov1970/curl that referenced this pull request Apr 13, 2026
To fix cast from 'char *' to 'CURLU *' (aka 'struct Curl_URL *')
increases required alignment from 1 to 8

Follow-up to 3407bee

Closes curl#21298
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
To fix cast from 'char *' to 'CURLU *' (aka 'struct Curl_URL *')
increases required alignment from 1 to 8

Follow-up to 3407bee

Closes curl#21298
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