CFURLCreateWithBytes() failed on iOS 13.4 Beta

Hello, we have found a CFURLCreateWithBytes() issue on iOS 13.4 Beta (installed on iPhone SE, MLXN2TA/A).

We expect CFURLCreateWithBytes() should return a valid CFURLRef rather than nil.


Here is the sample code

    char        pBuf[2048] = {0};
    int    ui32Len;
    CFIndex        nread;
    CFURLRef    fmyURL = NULL;
  
    nread = snprintf(pBuf, sizeof(pBuf), "https://www.apple.com:443/tw");
    ui32Len = sizeof(pBuf)-nread;
  
    fmyURL = CFURLCreateWithBytes(kCFAllocatorDefault, (UInt8 *)pBuf, nread+ui32Len, kCFStringEncodingUTF8, NULL);
     if(NULL == fmyURL){
         NSLog(@"Failed - iOS 13.4 Beta goes here");
    }
     else{
         NSLog(@"Success - iOS 13.3 is OK");
     }



However, CFURLCreateWithBytes() always returns nil on iOS 13.4 Beta.

CFURLCreateWithBytes() is working properly on all previous iOS versions.

Replies

The issue still can reproduce by Xcode 12.0.1 + iOS 14.