提交 51037651 编写于 作者: V vit9696

OcBootManagementLib: Fix deleting boot-args without value

上级 bea6c644
......@@ -14,6 +14,7 @@ OpenCore Changelog
- Added `AllowRelocationBlock` quirk for older macOS and safe mode
- Fixed CPU frequency calculation on AMD 19h family
- Updated recovery_urls
- Fixed `DisableSingleUser` quirk when Apple Secure Boot is enabled
#### v0.6.3
- Added support for xml comments in plist files
......
......@@ -120,23 +120,31 @@ OcRemoveArgumentFromCmd (
IN CONST CHAR8 *Argument
)
{
CHAR8 *Match;
CHAR8 *Match;
CHAR8 *Updated;
UINTN ArgumentLength;
Match = NULL;
ArgumentLength = AsciiStrLen (Argument);
Match = CommandLine;
do {
Match = AsciiStrStr (CommandLine, Argument);
if (Match && (Match == CommandLine || *(Match - 1) == ' ')) {
Match = AsciiStrStr (Match, Argument);
if (Match != NULL && (Match == CommandLine || *(Match - 1) == ' ')
&& (Match[ArgumentLength - 1] == '='
|| Match[ArgumentLength] == ' '
|| Match[ArgumentLength] == '\0')) {
while (*Match != ' ' && *Match != '\0') {
*Match++ = ' ';
}
} else if (Match != NULL) {
++Match;
}
} while (Match != NULL);
//
// Write zeroes to reduce data leak
//
CHAR8 *Updated = CommandLine;
Updated = CommandLine;
while (CommandLine[0] == ' ') {
CommandLine++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册