Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.3
-
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
For Gerrit Dashboard: QTBUG-21254 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
94878,4 | Add some minimal size checking for dynamically loaded resources | dev | qt/qtbase | Status: MERGED | +2 | 0 |