From: Alan Modra Date: Sun, 7 Feb 2021 02:53:34 +0000 (+1030) Subject: asan: unwind-ia64.c: stack buffer overflow X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=de8d4203109ae04c05a716c1afb2d5a487e9b1fe;p=binutils-gdb.git asan: unwind-ia64.c: stack buffer overflow Printing "invalid" is better than printing an uninitialised buffer and occasionally running off the end of the buffer. * unwind-ia64.c (unw_print_xyreg): Don't leave output buffer uninitialised on invalid input. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 23a8d8eafaf..69150272843 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2021-02-07 Alan Modra + + * unwind-ia64.c (unw_print_xyreg): Don't leave output buffer + uninitialised on invalid input. + 2021-02-06 Alan Modra PR 27349 diff --git a/binutils/unwind-ia64.c b/binutils/unwind-ia64.c index 6eef917a6a9..fb22f3fd54f 100644 --- a/binutils/unwind-ia64.c +++ b/binutils/unwind-ia64.c @@ -156,6 +156,10 @@ unw_print_xyreg (char *cp, unsigned int x, unsigned int ytreg) case 2: /* br */ sprintf (cp, "b%u", (ytreg & 0x1f)); break; + + default: + strcpy (cp, "invalid"); + break; } }