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

MdePkg: Update BASE_CR macro in Base.h for a Coverity error #10556

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

philnoh2
Copy link
Contributor

Coverity is a static analysis tool. It detects the macro as an error (case to incompatible type, cert_exp39_c_violation). The update resolves the error and supports compliance with the static tool.

For example,
MdeModulePkg\Universal\HiiDatabaseDxe\Database.c

Code :
Entry = BASE_CR (Link, VARSTORAGE_DEFAULT_DATA, Entry);

Coverity Error :
(3) Event cast_to_incompatible_type: Casting "(CHAR8 *)Link - 0ULL" of type "CHAR8 *" to incompatible type "VARSTORAGE_DEFAULT_DATA *".
(4) Event assign: Assigning: "Entry" = "(VARSTORAGE_DEFAULT_DATA *)((CHAR8 *)Link - 0ULL)".
Also see events: [cert_exp39_c_violation]

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

The update has been tested and verified on AMD EDKII bios. With it, the Coverity error is resolved.

Integration Instructions

N/A

Coverity is a static analysis tool. It detects the macro as an error
(case to incompatible type, cert_exp39_c_violation). The update resolves
the error and supports compliance with the static analysis tool.

Signed-off-by: Phil Noh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant