-
Notifications
You must be signed in to change notification settings - Fork 99
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
MfciPkg/MfciDxe: Fix GCC compilation issue in a test #107
MfciPkg/MfciDxe: Fix GCC compilation issue in a test #107
Conversation
GCC states `Dummy` and `FakeCertificate` may be used uninitialized since it is not assigned an initial value before being passed to functions in some tests. `Dummy` Example: ``` INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:317:12: error: ‘Dummy’ may be used uninitialized [-Werror=maybe-uninitialized] INFO - 317 | Status = ValidateBlobWithXdrCertificates (&Dummy, sizeof (Dummy), NULL, sizeof (mCert_Trusted_CA_Root_xdr)); INFO - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:144:1: note: by argument 1 of type ‘const UINT8 *’ {aka ‘const unsigned char *’} to ‘ValidateBlobWithXdrCertificates’ declared here ``` `FakeCertificate` Example: ``` INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:358:12: error: ‘FakeCertificate’ may be used uninitialized [-Werror=maybe-uninitialized] INFO - 358 | Status = ValidateBlobWithXdrCertificates (&Dummy, sizeof (Dummy), &FakeCertificate, sizeof (FakeCertificate)); INFO - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` This change initializes the values as necessary to prevent the error. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Note: This PR will not pass build due to the Please review this change in the meantime so once that is in, this can fix mu_plus and unblock other pull requests. |
Well, this did not build |
## Description Fixes microsoft#106 GCC states `Dummy` and `FakeCertificate` may be used uninitialized since it is not assigned an initial value before being passed to functions in some tests. `Dummy` Example: ``` INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:317:12: error: ‘Dummy’ may be used uninitialized [-Werror=maybe-uninitialized] INFO - 317 | Status = ValidateBlobWithXdrCertificates (&Dummy, sizeof (Dummy), NULL, sizeof (mCert_Trusted_CA_Root_xdr)); INFO - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:144:1: note: by argument 1 of type ‘const UINT8 *’ {aka ‘const unsigned char *’} to ‘ValidateBlobWithXdrCertificates’ declared here ``` `FakeCertificate` Example: ``` INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:358:12: error: ‘FakeCertificate’ may be used uninitialized [-Werror=maybe-uninitialized] INFO - 358 | Status = ValidateBlobWithXdrCertificates (&Dummy, sizeof (Dummy), &FakeCertificate, sizeof (FakeCertificate)); INFO - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` This change initializes the values as necessary to prevent the error. - [ ] Breaking change? - Will this change break pre-existing builds or functionality without action being taken? **No** - Simple GCC compilation fix ## How This Was Tested Verified compilation before (fails as shown above) and after (does not fail) with fix in this change. ## Integration Instructions None - This will resolve a GCC build error that may have been encountered in the MFCI tests. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
## Description Fixes microsoft#106 GCC states `Dummy` and `FakeCertificate` may be used uninitialized since it is not assigned an initial value before being passed to functions in some tests. `Dummy` Example: ``` INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:317:12: error: ‘Dummy’ may be used uninitialized [-Werror=maybe-uninitialized] INFO - 317 | Status = ValidateBlobWithXdrCertificates (&Dummy, sizeof (Dummy), NULL, sizeof (mCert_Trusted_CA_Root_xdr)); INFO - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:144:1: note: by argument 1 of type ‘const UINT8 *’ {aka ‘const unsigned char *’} to ‘ValidateBlobWithXdrCertificates’ declared here ``` `FakeCertificate` Example: ``` INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:358:12: error: ‘FakeCertificate’ may be used uninitialized [-Werror=maybe-uninitialized] INFO - 358 | Status = ValidateBlobWithXdrCertificates (&Dummy, sizeof (Dummy), &FakeCertificate, sizeof (FakeCertificate)); INFO - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` This change initializes the values as necessary to prevent the error. - [ ] Breaking change? - Will this change break pre-existing builds or functionality without action being taken? **No** - Simple GCC compilation fix ## How This Was Tested Verified compilation before (fails as shown above) and after (does not fail) with fix in this change. ## Integration Instructions None - This will resolve a GCC build error that may have been encountered in the MFCI tests. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
## Description Fixes microsoft#106 GCC states `Dummy` and `FakeCertificate` may be used uninitialized since it is not assigned an initial value before being passed to functions in some tests. `Dummy` Example: ``` INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:317:12: error: ‘Dummy’ may be used uninitialized [-Werror=maybe-uninitialized] INFO - 317 | Status = ValidateBlobWithXdrCertificates (&Dummy, sizeof (Dummy), NULL, sizeof (mCert_Trusted_CA_Root_xdr)); INFO - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:144:1: note: by argument 1 of type ‘const UINT8 *’ {aka ‘const unsigned char *’} to ‘ValidateBlobWithXdrCertificates’ declared here ``` `FakeCertificate` Example: ``` INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:358:12: error: ‘FakeCertificate’ may be used uninitialized [-Werror=maybe-uninitialized] INFO - 358 | Status = ValidateBlobWithXdrCertificates (&Dummy, sizeof (Dummy), &FakeCertificate, sizeof (FakeCertificate)); INFO - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` This change initializes the values as necessary to prevent the error. - [ ] Breaking change? - Will this change break pre-existing builds or functionality without action being taken? **No** - Simple GCC compilation fix ## How This Was Tested Verified compilation before (fails as shown above) and after (does not fail) with fix in this change. ## Integration Instructions None - This will resolve a GCC build error that may have been encountered in the MFCI tests. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
## Description Fixes #106 GCC states `Dummy` and `FakeCertificate` may be used uninitialized since it is not assigned an initial value before being passed to functions in some tests. `Dummy` Example: ``` INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:317:12: error: ‘Dummy’ may be used uninitialized [-Werror=maybe-uninitialized] INFO - 317 | Status = ValidateBlobWithXdrCertificates (&Dummy, sizeof (Dummy), NULL, sizeof (mCert_Trusted_CA_Root_xdr)); INFO - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:144:1: note: by argument 1 of type ‘const UINT8 *’ {aka ‘const unsigned char *’} to ‘ValidateBlobWithXdrCertificates’ declared here ``` `FakeCertificate` Example: ``` INFO - /s/MfciPkg/MfciDxe/Test/MfciMultipleCertsHostTest.c:358:12: error: ‘FakeCertificate’ may be used uninitialized [-Werror=maybe-uninitialized] INFO - 358 | Status = ValidateBlobWithXdrCertificates (&Dummy, sizeof (Dummy), &FakeCertificate, sizeof (FakeCertificate)); INFO - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` This change initializes the values as necessary to prevent the error. - [ ] Breaking change? - Will this change break pre-existing builds or functionality without action being taken? **No** - Simple GCC compilation fix ## How This Was Tested Verified compilation before (fails as shown above) and after (does not fail) with fix in this change. ## Integration Instructions None - This will resolve a GCC build error that may have been encountered in the MFCI tests. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Description
Fixes #106
GCC states
Dummy
andFakeCertificate
may be used uninitialized since it is not assigned an initial value before being passed to functions in some tests.Dummy
Example:FakeCertificate
Example:This change initializes the values as necessary to prevent the error.
No - Simple GCC compilation fix
How This Was Tested
Verified compilation before (fails as shown above) and after (does not fail) with fix in this change.
Integration Instructions
None - This will resolve a GCC build error that may have been encountered in the MFCI tests.
Signed-off-by: Michael Kubacki michael.kubacki@microsoft.com