MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0024088Open CASCADE[OCCT] OCCT:DRAWpublic2013-07-25 12:542014-05-05 13:37
Reporterkgv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformWindowsOSVC++ 2008OS Version64 bit
Product Version[OCCT] 6.3.1 
Target Version[OCCT] 6.7.1Fixed in Version[OCCT] 6.7.1 
Summary0024088: Unsafe window handle management in Draw using GetWindowLong
DescriptionDraw/MainWindow.cxx contains code which uses GetWindowLong/SetWindowLong functions to store window handle.

This is invalid on x86_64 systems and may cause crash if handle value exceed 32-bit boundary.

Also CLIENTWND is set to 0 which looks suspicions (DWL_MSGRESULT is not for custom use according to MSDN).
TagsNo tags attached.
Test case numberNot needed
Attached Files

- Relationships
related to 0023904closedkgv Multiple warning on Windows x86_64 target concerning WinAPI usage 

-  Notes
(0027417)
omy (developer)
2014-01-09 12:25

Dear kgv,
Please, review the changes made in branch CR24088.
(0027420)
kgv (developer)
2014-01-09 16:15

Dear omy,

please proceed the same issues within other files in Draw package.
(like this one:)
#ifndef _WIN64
  hInstance = (HANDLE)GetWindowLong(hWndFrame, GWL_HINSTANCE);
#else
  hInstance = (HANDLE)GetWindowLong(hWndFrame, GWLP_HINSTANCE);
#endif
(0027430)
omy (developer)
2014-01-10 10:45

Dear kgv,
I've made the necessary corrections.
Please, review the branch CR24088_1
(0027432)
kgv (developer)
2014-01-10 12:29

Dear omy,

-  DWORD aWinStyle   = GetWindowLong (win, GWL_STYLE);
-  DWORD aWinStyleEx = GetWindowLong (win, GWL_EXSTYLE);
+  DWORD aWinStyle   = GetWindowLongPtr (win, GWL_STYLE);
+  DWORD aWinStyleEx = GetWindowLongPtr (win, GWL_EXSTYLE);

these changes are unrelated to bug.
Other part of the patch looks OK.
(0027433)
omy (developer)
2014-01-10 12:56

Dear kgv,
I've reverted the mentioned changes.
Please, review.
(0027434)
kgv (developer)
2014-01-10 13:53

Dear Bugmaster,

patch in branch CR24088_1 is ready for testing.
(0027451)
mkv (tester)
2014-01-13 14:08

Dear BugMaster,

Branch CR24088_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: a5d18d0ce61475b82bea512527f028fae176585e

Number of compiler warnings:

occt component :
Linux: 54 (55 on master)
Windows: 1 (1 on master)

products component :
Linux: 20 (20 on master)
Windows: 2 (2 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 358021636 / 357072716
Total CPU difference: 44356.07000000028 / 42990.47999999986

Testing on Windows:
Total MEMORY difference: 414002516 / 412488216
Total CPU difference: 34128.8125 / 32601.78125

There are not differences in images found by testdiff.

- Related Changesets
occt: master e89e2d67
Timestamp: 2014-01-16 08:16:56
Author: omy
Committer: bugmaster
Details ] Diff ]
0024088: Unsafe window handle management in Draw using GetWindowLong

Replaced Get-/SetWindowLong with Get-/SetWindowLongPtr in files of TKDraw.

Reverted the unrelated changes
mod - src/Draw/CommandWindow.cxx Diff ] File ]
mod - src/Draw/Draw_Window.cxx Diff ] File ]
mod - src/Draw/init.cxx Diff ] File ]
mod - src/Draw/MainWindow.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2013-07-25 12:54 kgv New Issue
2013-07-25 12:54 kgv Assigned To => mkv
2013-07-25 12:55 kgv Relationship added related to 0023904
2013-07-25 12:55 kgv Target Version => 6.7.0
2013-07-29 15:47 mkv Assigned To mkv => kgv
2013-07-29 15:47 mkv Status new => assigned
2013-10-18 07:38 kgv Product Version => 6.3.1
2013-10-18 07:38 kgv Target Version 6.7.0 => 6.7.1
2014-01-08 14:55 kgv Assigned To kgv => omy
2014-01-09 12:25 omy Note Added: 0027417
2014-01-09 12:25 omy Assigned To omy => kgv
2014-01-09 12:25 omy Status assigned => resolved
2014-01-09 16:15 kgv Note Added: 0027420
2014-01-09 16:15 kgv Assigned To kgv => omy
2014-01-09 16:15 kgv Status resolved => assigned
2014-01-10 10:45 omy Note Added: 0027430
2014-01-10 10:45 omy Assigned To omy => kgv
2014-01-10 10:45 omy Status assigned => resolved
2014-01-10 12:29 kgv Note Added: 0027432
2014-01-10 12:29 kgv Assigned To kgv => omy
2014-01-10 12:29 kgv Status resolved => assigned
2014-01-10 12:56 omy Note Added: 0027433
2014-01-10 12:56 omy Assigned To omy => kgv
2014-01-10 12:56 omy Status assigned => resolved
2014-01-10 13:53 kgv Note Added: 0027434
2014-01-10 13:53 kgv Assigned To kgv => bugmaster
2014-01-10 13:53 kgv Status resolved => reviewed
2014-01-10 14:09 mkv Assigned To bugmaster => mkv
2014-01-13 14:08 mkv Note Added: 0027451
2014-01-13 14:09 mkv Test case number => Not needed
2014-01-13 14:09 mkv Assigned To mkv => bugmaster
2014-01-13 14:09 mkv Status reviewed => tested
2014-01-21 11:22 bugmaster Changeset attached => occt master e89e2d67
2014-01-21 11:22 bugmaster Status tested => verified
2014-01-21 11:22 bugmaster Resolution open => fixed
2014-05-05 13:34 aiv Status verified => closed
2014-05-05 13:37 aiv Fixed in Version => 6.7.1


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker