Branch: refs/heads/master Home: https://github.com/tianocore/edk2 Commit: ef3a1ef397a2677cccd0e3e7f1287f29f0094e17 https://github.com/tianocore/edk2/commit/ef3a1ef397a2677cccd0e3e7f1287f29f0094e17 Author: Tormod Volden <debian.tor...@gmail.com> Date: 2024-12-16 (Mon, 16 Dec 2024)
Changed paths: M ShellPkg/Library/UefiShellLib/UefiShellLib.c Log Message: ----------- ShellPkg/UefiShellLib: Prevent out-of-bounds access If InternalShellStrHexToUint64() is passed a string that starts with 'X' or 'x' it would try to read the byte before the start of the string buffer. Instead check if leading zeroes have been consumed. Signed-off-by: Tormod Volden <debian.tor...@gmail.com> Commit: e11a912aa3bd6b3ad69bb90f36f6860de33d846a https://github.com/tianocore/edk2/commit/e11a912aa3bd6b3ad69bb90f36f6860de33d846a Author: Tormod Volden <debian.tor...@gmail.com> Date: 2024-12-16 (Mon, 16 Dec 2024) Changed paths: M ShellPkg/Library/UefiShellLib/UefiShellLib.c Log Message: ----------- ShellPkg/UefiShellLib: Correct check for empty string StrSize() will never return zero since it counts the terminating NULL character. An empty string will have the storage size of the terminator. Signed-off-by: Tormod Volden <debian.tor...@gmail.com> Commit: f34a945a8024b8cb548168cae3a4a81600620ebb https://github.com/tianocore/edk2/commit/f34a945a8024b8cb548168cae3a4a81600620ebb Author: Tormod Volden <debian.tor...@gmail.com> Date: 2024-12-16 (Mon, 16 Dec 2024) Changed paths: M ShellPkg/Library/UefiShellLib/UefiShellLib.c Log Message: ----------- ShellPkg/UefiShellLib: Simplify check for empty string StrSize() uses StrLen() which counts until the terminating NULL character. For checking for an empty string it is more efficient to directly check for the NULL terminator instead of calling StrSize(). Signed-off-by: Tormod Volden <debian.tor...@gmail.com> Commit: d63d5884d7c2f7660175161187ce90852bc2a891 https://github.com/tianocore/edk2/commit/d63d5884d7c2f7660175161187ce90852bc2a891 Author: Tormod Volden <debian.tor...@gmail.com> Date: 2024-12-16 (Mon, 16 Dec 2024) Changed paths: M ShellPkg/Library/UefiShellLib/UefiShellLib.c Log Message: ----------- ShellPkg/UefiShellLib: Only write value if successful conversion The ShellConvertStringToUint64() function documentation says: "Upon a successful return the value of the conversion." So do not write any value if the conversion failed. Signed-off-by: Tormod Volden <debian.tor...@gmail.com> Commit: e99d532fd7224e68026543834ed9c0fe3cfaf88c https://github.com/tianocore/edk2/commit/e99d532fd7224e68026543834ed9c0fe3cfaf88c Author: Tormod Volden <debian.tor...@gmail.com> Date: 2024-12-16 (Mon, 16 Dec 2024) Changed paths: M ShellPkg/Library/UefiShellLib/UefiShellLib.c Log Message: ----------- ShellPkg/UefiShellLib: Accept "0 " as valid numeric string InternalShellIsHexOrDecimalNumber() would fail to interpret e.g. "0 " or "00 " as valid numeric strings. After skipping the "0" digits as leading zeroes, it would check if the next character is a valid hex or decimal digit, which would then fail on the terminating character. Therefore return success if "leading" zeroes have been consumed and there are no more characters. InternalShellStrHexToUint64() would fail to interpret e.g. "0 " or "00 " as valid numeric strings. After skipping the "0" digits as leading zeroes, it would find itself surprised by the following space. Restrict the "bad space" check to the case where it had just consumed the "x" or "X" marker. Otherwise the space is fine (depending on StopAtSpace either end of number or interspersed space) since there were only zeroes so far. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3080 Signed-off-by: Tormod Volden <debian.tor...@gmail.com> Compare: https://github.com/tianocore/edk2/compare/7936ffa1e60e...e99d532fd722 To unsubscribe from these emails, change your notification settings at https://github.com/tianocore/edk2/settings/notifications _______________________________________________ edk2-commits mailing list edk2-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-commits