BaseStackCheckLib: Fix STACK FAULT message

__builtin_return_address returns a pointer, not a string. Fix
the STACK FAULT message in BaseStackCheckLib appropriately.

Signed-off-by: Jake Garver <jake@nvidia.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Jake Garver 2023-10-05 09:18:31 -07:00 committed by mergify[bot]
parent 7e18c9a788
commit b59ab98049
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@
to exiting the function. If the "canary" is overwritten __stack_chk_fail() to exiting the function. If the "canary" is overwritten __stack_chk_fail()
is called. This is GCC specific code. is called. This is GCC specific code.
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Copyright (c) 2012, Apple Inc. All rights reserved.<BR> Copyright (c) 2012, Apple Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
@ -34,7 +35,7 @@ __stack_chk_fail (
{ {
UINT8 DebugPropertyMask; UINT8 DebugPropertyMask;
DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow in function %a.\n", __builtin_return_address (0))); DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow at 0x%p.\n", RETURN_ADDRESS (0)));
// //
// Generate a Breakpoint, DeadLoop, or NOP based on PCD settings even if // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings even if