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

Fix the potential secure issues from static code scan #313

Merged
merged 4 commits into from
Aug 13, 2020
Merged

Conversation

wcwang
Copy link
Contributor

@wcwang wcwang commented Aug 13, 2020

After the security check of the static code scanning tool Coverity, these security patches are made based on the scan results.

wcwang added 4 commits August 13, 2020 11:02
The return value of MmGetMdlPfnArray() cannot be NULL according to the
macro definition. The condition judgement statement will never be true.
Remove the dead code according to the analysis result of Coverity.

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
HAX_MEM_PAGABLE and HAX_MEM_NONPAGE are mutually exclusive flags. It
will be strict to use `else if` instead of `if`. Optimize the code
according to the analysis result of Coverity.

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
The potentially overflowing expression with type int is used to assign
to an expression of type uint64_t. Correct the code according to the
analysis result of Coverity.

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Comment out the unreachable code according to the analysis result of
Coverity.

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
@wcwang wcwang requested a review from coxuintel August 13, 2020 03:38
@HaxmCI HaxmCI added CI:Build Pass CI:Build Pass CI:Mac Test Pass CI:Mac Test Pass labels Aug 13, 2020
Copy link
Contributor

@coxuintel coxuintel left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@wcwang wcwang merged commit d906fde into master Aug 13, 2020
@wcwang wcwang deleted the secure-scan branch August 13, 2020 07:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI:Build Pass CI:Build Pass CI:Mac Test Pass CI:Mac Test Pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants