Files
Mingjie Shen ee0084a071 ShellPkg/Mv: Harden and optimize trailing-slash trimming
- 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>
2025-12-03 17:41:35 +00:00
..