aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-07-01 12:35:01 +0100
committerNick Clifton <nickc@redhat.com>2016-07-01 12:35:01 +0100
commit98a4fc78f9dab76b5ada3551a7bef36db8a3ed05 (patch)
treed5669d184079c4ad1d2432a6203d22e2db5fb8bd /gas
parent20aa2c606ef682889722b03b1d874befa84fbf53 (diff)
downloadgdb-98a4fc78f9dab76b5ada3551a7bef36db8a3ed05.zip
gdb-98a4fc78f9dab76b5ada3551a7bef36db8a3ed05.tar.gz
gdb-98a4fc78f9dab76b5ada3551a7bef36db8a3ed05.tar.bz2
Fix potential buffer overflows with sprintf and very large integer values.
binutuils* prdbg.c (pr_enum_type): Use a buffer big enough to hold an extremely large decimal value. (pr_range_type): Likewise. (pr_array_type): Likewise. (pr_struct_field): Likewise. (pr_class_baseclass): Likewise. (pr_class_method_variant): Likewise. (pr_tag_type): Likewise. (pr_int_constant): Likewise. (pr_typed_constant): Likewise. (pr_variable): Likewise. (pr_function_parameter): Likewise. (pr_start_block): Likewise. (pr_lineno): Likewise. (pr_end_block): Likewise. (tg_enum_type): Likewise. (tg_int_constant): Likewise. (tg_typed_constant): Likewise. (tg_start_block): Likewise. gas * macro.c (macro_expand_body): Use a buffer big enough to hold an extremely large integer.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/macro.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 1825738..40a9a2b 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-01 Nick Clifton <nickc@redhat.com>
+
+ * macro.c (macro_expand_body): Use a buffer big enough to hold an
+ extremely large integer.
+
2016-07-01 Jan Beulich <jbeulich@suse.com>
* testsuite/gas/i386/mpx-inval-2.l: Relax for COFF targets.
diff --git a/gas/macro.c b/gas/macro.c
index 0d1a1d2..deb4a49 100644
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -842,7 +842,7 @@ macro_expand_body (sb *in, sb *out, formal_entry *formals,
{
/* Sub in the macro invocation number. */
- char buffer[10];
+ char buffer[12];
src++;
sprintf (buffer, "%d", macro_number);
sb_add_string (out, buffer);