mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
- 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> |
||
|---|---|---|
| .. | ||
| Attrib.c | ||
| Cd.c | ||
| Cp.c | ||
| Load.c | ||
| Ls.c | ||
| Map.c | ||
| MkDir.c | ||
| Mv.c | ||
| Parse.c | ||
| Reset.c | ||
| Rm.c | ||
| Set.c | ||
| TimeDate.c | ||
| UefiShellLevel2CommandsLib.c | ||
| UefiShellLevel2CommandsLib.h | ||
| UefiShellLevel2CommandsLib.inf | ||
| UefiShellLevel2CommandsLib.uni | ||
| Vol.c | ||