Page MenuHomeFreeBSD

libefivar: CodeQL Fixes
ClosedPublic

Authored by jlduran on Feb 19 2025, 3:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 9, 5:50 AM
Unknown Object (File)
Mar 23 2025, 2:22 PM
Unknown Object (File)
Mar 12 2025, 1:26 AM
Unknown Object (File)
Mar 1 2025, 11:56 PM
Unknown Object (File)
Mar 1 2025, 1:28 AM
Unknown Object (File)
Feb 23 2025, 3:14 AM
Unknown Object (File)
Feb 21 2025, 1:14 AM
Unknown Object (File)
Feb 20 2025, 10:23 PM
Subscribers
None

Details

Summary

Includes changes across the repo for the following CodeQL rules:

  • cpp/comparison-with-wider-type
  • cpp/overflow-buffer
  • cpp/redundant-null-check-param
  • cpp/uselesstest

Obtained from: https://github.com/tianocore/edk2/commit/b7735a087afce6a5157b61e5450b6848ed535a14

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jlduran created this revision.

Commit message from upstream sucks.

The vast majority of this change is to make CreateDeviceNode returning NULL survivable.

Plus a number of dubious changes that don't really help (the asserts inside if's really should have been deleted instead, since it was asserting that nobody ever passed in a NULL, though the wisdom of that is kinda sketchy given the rest of the code).

So not a huge fan, but it's upstream, and we'd get it the next time we did a bulk import anyway.

lib/libefivar/efivar-dp-format.c
1911

This assert is now never going to fire and is completely useless.

lib/libefivar/efivar-dp-parse.c
1041

Arguably, all these should use this sort of pattern.... but upstream is a bit inconsistent at the best of times.

3154

This one should have just been if Uri == NULL return too. This is correct, but confusing.

This revision is now accepted and ready to land.Feb 19 2025, 6:00 PM

Yes, it seems to be a recurring issue with EDK2. I'll modify the commit message to accommodate some this information. My main objective was to incorporate D49060. Thanks.

This revision was automatically updated to reflect the committed changes.