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.
This commit is contained in:
Alan Modra 2021-02-07 13:23:34 +10:30
parent cca043e071
commit de8d420310
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2021-02-07 Alan Modra <amodra@gmail.com>
* unwind-ia64.c (unw_print_xyreg): Don't leave output buffer
uninitialised on invalid input.
2021-02-06 Alan Modra <amodra@gmail.com>
PR 27349

View File

@ -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;
}
}