Commit b2c8092
[SR-7112] Fixed a case where CFStringGetCStringPtr returns a string without null termination
Changed _fastCStringContents (used in CFStringGetCStringPtr) to return NULL if required to return a string containing null termination.
Since this fix, if you call CFStringGetCStringPtr with a Swift-based CFString, it returns NULL.
Before the change: _fastCStringContents always returned a pointer to an ASCII string containing no NULL termination.
This is because the code was using unsafeBitCast to get internal pointer of String of Swift. Swift's string does not guarantee null termination.1 parent 34060d6 commit b2c8092
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
297 | 301 | | |
298 | 302 | | |
299 | 303 | | |
| |||
0 commit comments