Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-36787

QNetworkProxyFactory::systemProxyForQuery crash on Mac during PAC detection

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.4.1
    • 4.8.6, 5.2.1
    • Network: Proxies
    • None
    • Tested under OS X 10.7
    • macOS
    • ea4dcc5931d455e4ee3e958ffa54a9f54ab022c8 a83e4d1d9dd90d4563ce60f27dfb7802a780e33e 83bd9393e5564ea9168fda90c0f44456633a483a

    Description

      QNetworkProxyFactory::systemProxyForQuery() can crash on Mac if proxy auto-configuration using PAC is enabled and the URL contains spaces (or other non-URL chars).

      0   com.apple.CoreFoundation      	0x00007fff96c1bf45 CFURLCopyScheme + 37
      1   com.apple.CoreFoundation      	0x00007fff96c1ab20 CFURLCreateDataAndPropertiesFromResource + 64
      2   QtNetwork                     	0x0000000105e0b16f macQueryInternal(QNetworkProxyQuery const&) + 991
      3   QtNetwork                     	0x0000000105e0c452 QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery const&) 
      

      The problem is that the URL passed to CFURLCreateDataAndPropertiesFromResource() may be null.

      Steps to reproduce:

      1. Go to System Preferences -> Network
      2. Select the active network connection in the left-hand connection list
      3. Click the 'Advanced' button in the right-hand pane
      4. Select the 'Proxies' tab.
      5. Select the 'Automatic Proxy Configuration' option in the left-hand proxy type list
      6. In the URL field on the right, enter the following URL, note the spaces: "http://www.foobar.com/ invalid url"
      7. Click OK
      8. Click Apply
      9. Build and run the following test case:

      #include <QtCore/QUrl>
      #include <QtNetwork/QNetworkProxyFactory>
      
      int main(int,char**)
      {
      	QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery(QUrl("http://qt-project.org")));
      	return 0;
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-36787
        # Subject Branch Project Status CR V

        Activity

          People

            danimo Daniel Molkentin
            robertknight Robert Knight
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes