Skip to content
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

[SR-2666] CFStringGetCString fails with bufferSize 1 for zero length strings #3932

Closed
johnno1962 opened this issue Sep 16, 2016 · 0 comments
Closed
Assignees

Comments

@johnno1962
Copy link
Contributor

Previous ID SR-2666
Radar None
Original Reporter @johnno1962
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee @johnno1962
Priority Medium

md5: e7ebf0e1d370230c4351c00395881ddc

Issue Description:

During the port to Android of Foundation #622 I was seeing a crash in CFStringGetCString when called for zero length strings (bufferSize == 1) and had to put some defensive code around it https://github.com/SwiftJava/swift-corelibs-foundation/blob/master/CoreFoundation/Base.subproj/CFUtilities.c#L790. Was crashing at line https://github.com/SwiftJava/swift-corelibs-foundation/blob/master/CoreFoundation/String.subproj/CFString.c#L2182.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant