aboutsummaryrefslogtreecommitdiff
path: root/binutils/unwind-ia64.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-02-07 13:23:34 +1030
committerAlan Modra <amodra@gmail.com>2021-02-07 14:49:19 +1030
commitde8d4203109ae04c05a716c1afb2d5a487e9b1fe (patch)
treea06bfeefe5e6085fc4489bdb82d6ac32bad109b3 /binutils/unwind-ia64.c
parentcca043e07194c74aaa50161467c3b62e3b9ba3ac (diff)
downloadgdb-de8d4203109ae04c05a716c1afb2d5a487e9b1fe.zip
gdb-de8d4203109ae04c05a716c1afb2d5a487e9b1fe.tar.gz
gdb-de8d4203109ae04c05a716c1afb2d5a487e9b1fe.tar.bz2
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.
Diffstat (limited to 'binutils/unwind-ia64.c')
-rw-r--r--binutils/unwind-ia64.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/binutils/unwind-ia64.c b/binutils/unwind-ia64.c
index 6eef917..fb22f3f 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;
}
}