Microsoft KB Archive/218829

= FIX: CComEnumImpl<>::Skip Doesn't Handle Overflow Correctly =

Article ID: 218829

Article Last Modified on 2/24/2004

-

APPLIES TO

 Microsoft ActiveX Template Library 3.0, when used with:  Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Professional Edition

 Microsoft Visual C++ 6.0 Standard Edition 

-

<div class="notice_section">

This article was previously published under Q218829

<div class="symptoms_section">

SYMPTOMS
If an argument passed into CComEnumImpl<>::Skip is a negative number, then the pointer to the current enumeration may not be set correctly.

<div class="cause_section">

CAUSE
Following is the implementation of CComEnumImpl<>::Skip: template <class Base, const IID* piid, class T, class Copy> STDMETHODIMP CComEnumImpl<Base, piid, T, Copy>::Skip(ULONG celt) {   m_iter += celt; if (m_iter <= m_end) return S_OK; m_iter = m_end; return S_FALSE; }

M_iter points to the current enumeration. If celt is a negative number, Skip is supposed to set m_iter back "celt" items. If "m_iter + celt" results in a value that is less than m_begin, then this case is not handled and m_iter is set to an invalid pointer.

<div class="resolution_section">

RESOLUTION
This bug has been fixed in Visual Studio 6.0 Service Pack 3.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

Keywords: kbbug kbfix kbcollectionclass kbvs600sp3fix KB218829

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.