]> git.proxmox.com Git - mirror_edk2.git/commit
ArmPkg/DefaultExceptionHandlerLib: replace AsciiStrCat() with AsciiStrCatS()
authorLaszlo Ersek <lersek@redhat.com>
Fri, 21 Oct 2016 19:31:09 +0000 (21:31 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 25 Oct 2016 08:46:42 +0000 (10:46 +0200)
commita1848bc088c62ae5a19e20e95c22d7b4fb75d2cb
tree1f1ab5b4ba1fac594a68ffbdd1dbae15e81984ed
parentf00ace96f3c8e1dbfd0cd0d882b0c98cfbde37dc
ArmPkg/DefaultExceptionHandlerLib: replace AsciiStrCat() with AsciiStrCatS()

AsciiStrCat() is deprecated / disabled under the
DISABLE_NEW_DEPRECATED_INTERFACES feature test macro.

The caller of CpsrString() is required to pass in "ReturnStr" with 32
CHAR8 elements. (DefaultExceptionHandler() complies with this.) "Str" is
used to build "ReturnStr" gradually. Just before calling AsciiStrCat(),
"Str" points to the then-terminating NUL character in "ReturnStr".

The difference (Str - ReturnStr) gives the number of non-NUL characters
we've written thus far, hence (32 - (Str - ReturnStr)) yields the number
of remaining bytes in ReturnStr, including the ultimately terminating NUL
character.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael Zimmermann <sigmaepsilon92@gmail.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=164
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=165
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c