Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.1.1
-
None
-
Win32, VS2012
-
qtactiveqt: 0d29579baffd4f31a3ec39590117f4fee821694d (5.2.1, stable, 9.12.2013) Qt: 4: 3bef845f4623e0edcd52ddcffee3612f4f7f6779 (20.12.2013, 4.8.6)
Description
calling IEnumConnections->Skip does't skip element of the collection. It doesn't return a proper error code that indicates a successful completion.
It look like it manipulates with uninitialized data and produces undefined number of successful completions until finally retiring error code that indicates a successful completion.
void undefinedBehavior1( IQTCrashPtr qtObject ) { IConnectionPointPtr connectionPoint; IConnectionPointContainerPtr( qtObject )->FindConnectionPoint( __uuidof( IQTCrashEvents ), &connectionPoint ); IEnumConnectionsPtr connections; connectionPoint->EnumConnections( &connections ); int cnt = 0; while( connections->Skip( 1 ) == S_OK) { cnt++; } std::wcout << cnt << std::endl; // cnt is a random number }
Example project that demonstrates the crash is attached
Attachments
Issue Links
- relates to
-
QTBUG-35136 QAxConnection class is poorly dessigned
-
- Closed
-