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

QResource::registerResource does not perform check for resource file validity.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.0
    • 4.7.3
    • Build tools: rcc
    • None
    • Windows Vista/7/XP and Mac Os X Lion
    • f14470fa0062a71b9eeac7f6904fbc5d92c133d2

    Description

      QResource::registerResource performs only signature check for given resource file while registering (see QResource::registerSelf(), line "if(b[offset+0] != 'q' || b[offset+1] != 'r' ||" ), so any corrupted resource file with good signature will be successfully registered. There should be a method allowing to check resource file for validity to avoid crashes.

      Demo is attached. This application loads correct qrc file, then creates copy, truncates it and loads again.

      How to reproduce:
      1) upack zip
      2) run makerc.bat
      3) compile application
      4) run the app and the following line will cause crash: ui.label_2->setPixmap(QPixmap(":/bad/dummy/2.png"));

      Attachments

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

        Activity

          People

            hjk hjk
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes