Skip to content

Fix bad return in validate_hostname - #13498

Merged
JosiahWI merged 1 commit into
apache:masterfrom
JosiahWI:fix/validate-hostname-return
Aug 5, 2026
Merged

Fix bad return in validate_hostname#13498
JosiahWI merged 1 commit into
apache:masterfrom
JosiahWI:fix/validate-hostname-return

Conversation

@JosiahWI

@JosiahWI JosiahWI commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

The function has a bool return type, but returned -1 to indicate an error on UTF-8 conversion failure. This patch corrects the return statement to return false.

The function has a `bool` return type, but returned `-1` to indicate an error
on UTF-8 conversion failure. This patch corrects the return statement to return `false`.
@JosiahWI JosiahWI added this to the 11.0.0 milestone Aug 5, 2026
@JosiahWI JosiahWI self-assigned this Aug 5, 2026
Copilot AI lite review requested due to automatic review settings August 5, 2026 14:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Fixes validate_hostname returning an invalid value (-1) despite having a bool return type, ensuring UTF-8 conversion failures correctly return false.

Changes:

  • Replaces return -1; with return false; when ASN1_STRING_to_UTF8 fails.

@JosiahWI

JosiahWI commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

[approve ci autest 0]

@JosiahWI
JosiahWI requested a review from maskit August 5, 2026 15:24
@JosiahWI
JosiahWI merged commit d70bdb7 into apache:master Aug 5, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this to For v10.2.0 in ATS v10.2.x Aug 5, 2026
cmcfarlen pushed a commit that referenced this pull request Aug 6, 2026
The function has a `bool` return type, but returned `-1` to indicate an error
on UTF-8 conversion failure. This patch corrects the return statement to return `false`.

(cherry picked from commit d70bdb7)
@cmcfarlen cmcfarlen moved this from For v10.2.0 to Picked v10.2.0 in ATS v10.2.x Aug 6, 2026
@cmcfarlen cmcfarlen modified the milestones: 11.0.0, 10.2.0 Aug 6, 2026
@cmcfarlen

Copy link
Copy Markdown
Contributor

Cherry-picked to the 10.2.x branch as 79861fb for the 10.2.0 release.

@JosiahWI
JosiahWI deleted the fix/validate-hostname-return branch August 19, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Picked v10.2.0

Development

Successfully merging this pull request may close these issues.

validate_hostname() returns -1 on UTF-8 conversion failure, which converts to true in its bool return type

5 participants