Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[x86/Linux] fix a typo in FillRegDisplay method. #10547

Merged
merged 1 commit into from
Mar 29, 2017

Conversation

ragmani
Copy link

@ragmani ragmani commented Mar 29, 2017

#elif defined(_TARGET_X86_) // _TARGET_ARM_
    for (int i = 0; i < 7; i++)
    {
        *(&pRD->ctxPtrsOne.Esi + i) = (&pctx->Esi + i);
    }

An overflow occurs in struct _KNONVOLATILE_CONTEXT_POINTERS because the loop statement starts from Esi variable.

This is struct _KNONVOLATILE_CONTEXT_POINTERS.

1805 typedef struct _KNONVOLATILE_CONTEXT_POINTERS {
1806 
1807     // The ordering of these fields should be aligned with that
1808     // of corresponding fields in CONTEXT
1809     //
1810     // (See FillRegDisplay in inc/regdisp.h for details)
1811     PDWORD Edi;
1812     PDWORD Esi;
1813     PDWORD Ebx;
1814     PDWORD Edx;
1815     PDWORD Ecx;
1816     PDWORD Eax;
1817    
1818     PDWORD Ebp;
1819 
1820 } KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS;

This is stuct _CONTEXT.

1751 typedef struct _CONTEXT {
...
1768     ULONG   Edi;
1769     ULONG   Esi;
1770     ULONG   Ebx;
1771     ULONG   Edx;
1772     ULONG   Ecx;
1773     ULONG   Eax;
1774 
1775     ULONG   Ebp;
1776     ULONG   Eip;
...
1785 } CONTEXT, *PCONTEXT, *LPCONTEXT;

@dnfclas
Copy link

dnfclas commented Mar 29, 2017

@ragmani,
Thanks for your contribution.
To ensure that the project team has proper rights to use your work, please complete the Contribution License Agreement at https://cla2.dotnetfoundation.org.

It will cover your contributions to all .NET Foundation-managed open source projects.
Thanks,
.NET Foundation Pull Request Bot

@ragmani ragmani changed the title [x86/Linux] fix a typo of FillRegDisplay method. [x86/Linux] fix a typo in FillRegDisplay method. Mar 29, 2017
@ragmani
Copy link
Author

ragmani commented Mar 29, 2017

cc @parjong

@ragmani ragmani force-pushed the x86_linux_typo_FillRegDisplay branch from d7dfaa4 to f95d83d Compare March 29, 2017 06:34
Signed-off-by: ragmani <ragmani0216@gmail.com>
@dnfclas
Copy link

dnfclas commented Mar 29, 2017

@ragmani, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request.

Thanks, .NET Foundation Pull Request Bot

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for catching this!

@janvorli janvorli merged commit a1ad159 into dotnet:master Mar 29, 2017
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants