Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible errors #74

Open
andrew-boyarshin opened this issue Aug 9, 2019 · 1 comment
Open

Possible errors #74

andrew-boyarshin opened this issue Aug 9, 2019 · 1 comment
Labels
bug Something isn't working help-wanted This issue / or pull request is up for grabs for anyone in the community to help.

Comments

@andrew-boyarshin
Copy link

Detours/src/detours.cpp

Lines 1761 to 1764 in edc8b07

if (cxt.DETOURS_EIP >= (DETOURS_EIP_TYPE)(ULONG_PTR)o->pTrampoline &&
cxt.DETOURS_EIP < (DETOURS_EIP_TYPE)((ULONG_PTR)o->pTrampoline
+ sizeof(o->pTrampoline))
) {

V568 It's odd that 'sizeof()' operator evaluates the size of a pointer to a class, but not the size of the 'o->pTrampoline' class object. detours.cpp 1763

Would someone knowledgeable with the code check the presence of the error in this code block?

There is a large number of PVS-Studio messages, but this one is on a (relatively) hot execution path.

List of all other High-priority messages:

V595 The 'o->pTrampoline' pointer was utilized before it was verified against nullptr. Check lines: 1802, 1805. detours.cpp 1802
V763 Parameter 'pEntry' is always rewritten in function body before being used. disasm.cpp 448
V763 Parameter 'pEntry' is always rewritten in function body before being used. disasm.cpp 592
V730 Not all members of a class are initialized inside the constructor. Consider inspecting: m_nSegmentOverride, m_lScratchExtra, m_pbScratchTarget, m_rbScratchDst. disasm.cpp 328
V595 The 'pcbData' pointer was utilized before it was verified against nullptr. Check lines: 549, 554. image.cpp 549
V568 It's odd that 'sizeof()' operator evaluates the size of a pointer to a class, but not the size of the 'piidDst' class object. image.cpp 1836
V512 A call of the 'memset' function will lead to underflow of the buffer 'piidDst'. image.cpp 1836
V512 A call of the 'memset' function will lead to underflow of the buffer 'piidDst'. image.cpp 1878
@bgianfo bgianfo added the bug Something isn't working label Aug 20, 2020
@bgianfo bgianfo added hacktoberfest help-wanted This issue / or pull request is up for grabs for anyone in the community to help. labels Sep 30, 2020
@AnshuTrivedi
Copy link

@bgianfo what changes have to make?
Please can you help me in figuring out this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help-wanted This issue / or pull request is up for grabs for anyone in the community to help.
Projects
None yet
Development

No branches or pull requests

3 participants