Skip to content

Fix bounds checking error when parsing WWW-Authenticate field #5103

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

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

toffaletti
Copy link
Contributor

@toffaletti toffaletti commented Oct 11, 2024

Without the fix:

swift test --filter TestURLProtectionSpace.test_createWithInvalidAuth
Test Suite 'Selected tests' started at 2024-10-11 21:04:24.085
Test Suite 'TestURLProtectionSpace' started at 2024-10-11 21:04:24.095
Test Case 'TestURLProtectionSpace.test_createWithInvalidAuth' started at 2024-10-11 21:04:24.095
Swift/StringIndexValidation.swift:143: Fatal error: Substring index is out of bounds

^C*** Signal 5: Backtracing from 0xffff95642744... failed ***

With the fix:

Test Suite 'Selected tests' started at 2024-10-11 21:19:30.602
Test Suite 'TestURLProtectionSpace' started at 2024-10-11 21:19:30.612
Test Case 'TestURLProtectionSpace.test_createWithInvalidAuth' started at 2024-10-11 21:19:30.612
Test Case 'TestURLProtectionSpace.test_createWithInvalidAuth' passed (0.005 seconds)
Test Suite 'TestURLProtectionSpace' passed at 2024-10-11 21:19:30.617
	 Executed 1 test, with 0 failures (0 unexpected) in 0.005 (0.005) seconds
Test Suite 'Selected tests' passed at 2024-10-11 21:19:30.617
	 Executed 1 test, with 0 failures (0 unexpected) in 0.005 (0.005) seconds

@toffaletti toffaletti marked this pull request as ready for review October 11, 2024 21:23
Copy link
Contributor

@jrflat jrflat left a comment

Choose a reason for hiding this comment

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

Thanks!

@jrflat
Copy link
Contributor

jrflat commented Oct 12, 2024

@swift-ci please test

@toffaletti
Copy link
Contributor Author

CI failure seems unrelated to my changes.

/Users/ec2-user/jenkins/workspace/swift-corelibs-foundation-PR-macOS/branch-main/swift-corelibs-xctest/Sources/XCTest/Public/XCTestMain.swift:21:23: error: no such module 'SwiftFoundation'
    @_exported import SwiftFoundation
                      ^

note: Using global toolchain override 'Xcode Default'. (in target 'SwiftXCTest' from project 'XCTest')
** BUILD FAILED **


The following build commands failed:
	CompileSwift normal arm64 (in target 'SwiftXCTest' from project 'XCTest')
	SwiftCompile normal arm64 Compiling\ XCTestObservationCenter.swift,\ IgnoredErrors.swift,\

@parkera
Copy link
Contributor

parkera commented Oct 13, 2024

@shahmishal can we get macOS CI turned off on this repo? We don’t build swift-corelibs-foundation for macOS

@jrflat
Copy link
Contributor

jrflat commented Oct 15, 2024

Agree macOS failure looks unrelated, not unique to this PR

@jrflat jrflat merged commit f1b2fb2 into swiftlang:main Oct 15, 2024
2 of 3 checks passed
@toffaletti toffaletti deleted the fix-www-authenticate-parsing branch October 20, 2024 17:26
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 this pull request may close these issues.

3 participants