aboutsummaryrefslogtreecommitdiff
path: root/gas/macro.c
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/macro.c
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/macro.c')
-rw-r--r--gas/macro.c2
1 files changed, 1 insertions, 1 deletions
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);