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

Crash When Processing Empty Entries in TrieWriter During QtWebEngine 6.7.0 Build: Access Violation in WriteDispatchTables

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.3, 6.7.0
    • WebEngine
    • None
    • Operating System: Windows 11
      Compiler: MSVC x64 Visual Studio 2022
      Python Version: 3.9
      Build System: Ninja 1.12.1
    • Windows
    • Windows

    Description

      In QtWebEngine 6.7.0, when building the engine, a crash occurs due to an access violation in the TrieWriter::WriteDispatchTables function. This issue arises if an entry with an empty hostname is included. The crash happens when attempting to access the first character of the empty string in the following code:

      uint8_t candidate = (*start)->reversed_name.at(0); 

      This results in a STATUS_STACK_BUFFER_OVERRUN error, which crashes the application. The problem can be mitigated by skipping any empty entries before trying to access their characters.

      Steps to Reproduce:

      1. Build QtWebEngine 6.7.0 or a project that includes the TrieWriter component.
      2. Ensure that the set of entries passed to the WriteEntries function contains at least one entry with an empty hostname.
      3. Trigger the WriteEntries function, which calls WriteDispatchTables.
      4. Observe the crash or access violation when attempting to process the empty entry.

      Proposed Fix:

      To resolve this issue, add a check in the WriteEntries function to skip empty entries before passing them to WriteDispatchTables:

      for (auto* const entry : entries) {
          if (entry->name().empty()) {
              LOG(INFO) << "Skipping empty hostname entry";
              continue;
          }
          // Continue with the rest of the logic...
      } 

      This fix will prevent the function from attempting to access an empty string in WriteDispatchTables, avoiding the crash. Additional Information: The bug is present in QtWebEngine 6.7.0 during the build process. The crash occurs when an empty hostname entry is passed to WriteEntries, causing an access violation in WriteDispatchTables. This issue was identified by attempting to access the first character of an empty string in WriteDispatchTables.

       

      for more information see:
      Qt6.5.3 Build QtWebEngine for Windows x64. Error: transport_security_state_generator.exe failed with exit code 3221226505

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            esmaeil Esmaeil Sadeghi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes