This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fix address violation bugs when writing beyond the end of a local string buffer.
- From: Nick Clifton <nickc at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 8 Aug 2017 10:58:02 -0000
- Subject: [binutils-gdb] Fix address violation bugs when writing beyond the end of a local string buffer.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cea7a285058bcba5a54d6493d6914c720f5c40a8
commit cea7a285058bcba5a54d6493d6914c720f5c40a8
Author: Nick Clifton <nickc@redhat.com>
Date: Tue Aug 8 11:57:22 2017 +0100
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.
Diff:
---
binutils/ChangeLog | 7 +++++++
binutils/prdbg.c | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index c941aee..fa2b367 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,10 @@
+2017-08-08 Nick Clifton <nickc@redhat.com>
+
+ PR 21909
+ * prdbg.c (pr_int_type): Increase size of local string buffer.
+ (pr_float_type): Likewise.
+ (pr_bool_type): Likewise.
+
2017-08-02 Nick Clifton <nickc@redhat.com>
PR 21702
diff --git a/binutils/prdbg.c b/binutils/prdbg.c
index 9bd01bc..7b24fbe 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);