[ros-bugs] [Bug 4788] New: Suspicious HandleIndex in RtlpCreateAtomHandle

ReactOS.Bugzilla at reactos.org ReactOS.Bugzilla at reactos.org
Wed Aug 12 08:50:55 CEST 2009


http://www.reactos.org/bugzilla/show_bug.cgi?id=4788

           Summary: Suspicious HandleIndex in RtlpCreateAtomHandle
           Product: ReactOS
           Version: TRUNK
          Platform: x86 Hardware
        OS/Version: ReactOS
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: Kernel
        AssignedTo: ros-bugs at reactos.org
        ReportedBy: lovenystrom at hotmail.com
         QAContact: ros-bugs at reactos.org


Created an attachment (id=4223)
 --> (http://www.reactos.org/bugzilla/attachment.cgi?id=4223)
Patch against revision 42599 for RtlpCreateAtomHandle

Found a suspected cut/paste typo in reactos\ntoskrnl\rtl\libsupp.c

Here's the code exerpt with my suggested amendment:
in RtlpCreateAtomHandle:

526:   HandleIndex = (USHORT)((ULONG_PTR)Handle >> 2);
527:   /* FIXME - Handle Indexes >= 0xC000 ?! */
>528:  if ((ULONG_PTR)HandleIndex >> 2 < 0xC000)

> SUSPICIOUS: Did You really mean to shift the 'HandleIndex' 2 bits more ?
>   I think You meant to shift 'Handle' to get rid of the TagBits !?
>   To fix it: if (HandleIndex < 0xC000)

I attach a patch that fixes this suspected typo.
The fix is built in my local binaries, but test is pending,
since I still haven't a working kernel debugger setup.
My comment is in the patch, so edit that away if You apply it,
or just do the edit Yourself, in the sharp file.

If I'm wrong and You really meant to shift the HandleIndex,
then just file the patch in the trash can.

Best regards
- Love

PS. Gimme a hint - Should I refrain from putting such remarks in the patches ?
I mean, if I submit just the code, no re-edit would be necessary. DS.


-- 
Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the Ros-bugs mailing list