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

QCoreApplication with negative argc parameter causes memory allocation exception.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.0.0
    • Core: Other
    • None
    • win32/msvc9

    Description

      If QCoreApplication is passed a negative argc, it converts this to an unsigned integer and tries to allocate the memory unchecked. In the case of win/32, it tries to allocate off 4G when passed -1, and fails trying to do so.

      [I] MAF: Memory allocation failure of -1 bytes in new(UINT)

      {1 occurrence}

      Allocation location
      new(UINT) [C:\DEPOT\QT5\QTBASE\BIN\QTCORED5.DLL]
      <>=(UINT) [f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp:7]
      QCoreApplicationPrivate::QCoreApplicationPrivate(int&,char * *,UINT) [c:\depot\qt5\qtbase\src\corelib\kernel\qcoreapplication.cpp:293]
      , in_exec(false)
      , aboutToQuitEmitted(false)
      , threadData_clean(false)
      => {
      app_compile_version = flags & 0xffffff;
      static const char *const empty = "";
      if (argc == 0 || argv == 0) {
      QGuiApplicationPrivate::QGuiApplicationPrivate(int&,char * *,int) [c:\depot\qt5\qtbase\src\gui\kernel\qguiapplication.cpp:379]
      QApplicationPrivate::QApplicationPrivate(int&,char * *,Type::QCoreApplication,int) [c:\depot\qt5\qtbase\src\widgets\kernel\qapplication.cpp:161]
      QApplication::QApplication(int&,char * *,int) [c:\depot\qt5\qtbase\src\widgets\kernel\qapplication.cpp:555]
      DumpIDL [c:\depot\qt5\qtactiveqt\src\activeqt\control\qaxserver.cpp:1127]
      dumpIdl [c:\depot\qt5\qtactiveqt\src\tools\idc\main.cpp:176]
      runIdc(int,char * *) [c:\depot\qt5\qtactiveqt\src\tools\idc\main.cpp:292]
      main [c:\depot\qt5\qtactiveqt\src\tools\idc\main.cpp:334]

      please note: the failure is in the code:
      #ifdef Q_OS_WIN
      , origArgc(aargc)
      , origArgv(new char *[aargc])
      #endif

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              bilking Bill King
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes