mirror of
https://github.com/Dasharo/edk2.git
synced 2026-06-13 10:16:24 -07:00
ee0084a071
- Remove redundant null check in IsValidMove() per CodeQL cpp/redundant-null-check-simple. Specifically, drop the "DestPathWalker != NULL" condition from the trimming loop. Rationale: "DestPathCopy" is allocated at line 181 and checked for NULL at lines 182–183; "DestPathWalker" is initialized from "DestPathCopy" at line 186, so it cannot be NULL. - Cache length once in IsValidMove() and ValidateAndMoveFiles() so the trimming loop avoids repeated StrLen() calls. - Guard the zero-length case before indexing the last character to prevent out-of-bounds access. Signed-off-by: Mingjie Shen <shen497@purdue.edu>