-
Notifications
You must be signed in to change notification settings - Fork 332
Misc fixes... #735
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
Merged
Merged
Misc fixes... #735
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If variable_create_esl_with_one_signature() succeeds but CreateTimeBasedPayload() fails, we leak the allocation for our certificate. This patch frees it. Resolves: Coverity CID 457504 Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Resolves: Coverity CID 457502 Signed-off-by: Peter Jones <pjones@redhat.com>
Resolves: Coverity CID 457507 Signed-off-by: Peter Jones <pjones@redhat.com>
Coverity identified a resource leak of namen8 in mirror_mok_db(), and upon further examination nothing is even using it any more; we're allocating it and populating it for nothing. This removes all that. Resolves: Coverity CID 457510 Signed-off-by: Peter Jones <pjones@redhat.com>
If measuring a mok variable to the TPM returns failure, this function returns, but never frees the data intended to be measured. This frees it. Resolves: Coverity CID 457503 Signed-off-by: Peter Jones <pjones@redhat.com>
When we've split a mok variable into name0..nameN, we re-use the same buffer over and over, but we never free it at the end. This frees it. Resolves: Coverity CID 457501 Signed-off-by: Peter Jones <pjones@redhat.com>
scan-build notes that we assign bprop.hnd, an EFI_HANDLE for the device path protocol, to our loaded_image->li.DeviceHandle, and it thinks since bprop is uninitialized that means it can be NULL or garbage. I don't think that's actually true, because every path to that requires either returning an error or doing some variety of: status = BS->LocateDevicePath(&gEfiDevicePathProtocolGuid, &bp, &hnd) and checking its error, but only one of those paths explicitly sets a value, and static checkers can't tell what BS->LocateDevicePath does with the pointer. This patch avoids the issue by initializing the whole bprop structure to begin with. Signed-off-by: Peter Jones <pjones@redhat.com>
"gcc -fanalyzer" thinks that in simple_dir_filter(), we can get "next" to be a NULL pointer even when simple_dir_read_all() return success and we're iterating the total number of entries it claimed it returned. I don't think this is true, but to make it stop complaining I've added tests to that pointer that'll make it stop if it gets to the end of the list. Signed-off-by: Peter Jones <pjones@redhat.com>
It breaks every time somehow. Signed-off-by: Peter Jones <pjones@redhat.com>
jsetje
approved these changes
Mar 13, 2025
jsetje
approved these changes
Mar 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These are fixes discovered through
cov-scan, clang'sscan-build, andgcc -fanalyzer.