summaryrefslogtreecommitdiff
path: root/binutils/prdbg.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-08-08 11:57:22 +0100
committerNick Clifton <nickc@redhat.com>2017-08-08 11:57:22 +0100
commitcea7a285058bcba5a54d6493d6914c720f5c40a8 (patch)
tree39cb96bc135dd8fabcc9c1e81f5f695a09195d54 /binutils/prdbg.c
parent206c9c79ee24759c0e0af96e6722298b413f2716 (diff)
downloadbinutils-gdb-cea7a285058bcba5a54d6493d6914c720f5c40a8.tar.gz
Fix address violation bugs when writing beyond the end of a local string buffer.
PR 21909 * prdbg.c (pr_int_type): Increase size of local string buffer. (pr_float_type): Likewise. (pr_bool_type): Likewise.
Diffstat (limited to 'binutils/prdbg.c')
-rw-r--r--binutils/prdbg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/binutils/prdbg.c b/binutils/prdbg.c
index 9bd01bc071a..7b24fbe6161 100644
--- a/binutils/prdbg.c
+++ b/binutils/prdbg.c
@@ -581,7 +581,7 @@ static bfd_boolean
pr_int_type (void *p, unsigned int size, bfd_boolean unsignedp)
{
struct pr_handle *info = (struct pr_handle *) p;
- char ab[10];
+ char ab[40];
sprintf (ab, "%sint%d", unsignedp ? "u" : "", size * 8);
return push_type (info, ab);
@@ -593,7 +593,7 @@ static bfd_boolean
pr_float_type (void *p, unsigned int size)
{
struct pr_handle *info = (struct pr_handle *) p;
- char ab[10];
+ char ab[40];
if (size == 4)
return push_type (info, "float");
@@ -623,7 +623,7 @@ static bfd_boolean
pr_bool_type (void *p, unsigned int size)
{
struct pr_handle *info = (struct pr_handle *) p;
- char ab[10];
+ char ab[40];
sprintf (ab, "bool%d", size * 8);