Opened on 01/07/2015 at 06:05:46 PM
Closed on 01/13/2015 at 03:02:16 PM
Last modified on 02/19/2015 at 07:38:01 AM
#1762 closed defect (fixed)
Incorrect closing of HMODULE in process_by_any_exe_not_immersive::operator()
Reported by: | eric@adblockplus.org | Assignee: | eric@adblockplus.org |
---|---|---|---|
Priority: | Unknown | Milestone: | Adblock-Plus-for-Internet-Explorer-1.4 |
Module: | Adblock-Plus-for-Internet-Explorer | Keywords: | installer |
Cc: | Blocked By: | ||
Blocking: | #1187 | Platform: | Internet Explorer |
Ready: | no | Confidential: | no |
Tester: | Verified working: | ||
Review URL(s): |
Description
Environment
process_by_any_exe_not_immersive::operator(), used in the installer custom action, uses dynamic loading to use a system call introduced with Windows 8. The return value of LoadLibrary() is an HMODULE, which stands for "handle to a module". It is not, however, an true handle, and should not be closed.
The current version uses a smart handle class which closes the handle to the library. This generates an SEH exception in the operating system.
How to reproduce
Run the installer with MsiBreak at elevated privileges. Attach a debugger, which will trap the exception.
Observed behaviour
The exception shows up reliably in the debugger.
Expected behaviour
There should be no exception
How to Fix the Defect
Remove the use of the smart handle class, which is not only unnecessary but incorrect. Use of the plain return value is sufficient.
Attachments (0)
Change History (5)
comment:1 Changed on 01/07/2015 at 06:06:33 PM by eric@adblockplus.org
comment:2 Changed on 01/07/2015 at 07:44:01 PM by eric@adblockplus.org
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:3 Changed on 01/07/2015 at 10:30:36 PM by eric@adblockplus.org
- Owner set to eric@adblockplus.org
comment:4 Changed on 01/13/2015 at 03:02:16 PM by eric@adblockplus.org
- Resolution set to fixed
- Status changed from reviewing to closed
comment:5 Changed on 02/19/2015 at 07:38:01 AM by oleksandr
- Milestone set to Adblock-Plus-for-Internet-Explorer-1.4
Blocking #1187 because it's impossible to see the relevant code because the exception in the debugger closes the installer.