From 98a4fc78f9dab76b5ada3551a7bef36db8a3ed05 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 1 Jul 2016 12:35:01 +0100 Subject: 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. --- gas/macro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gas/macro.c') 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); -- cgit v1.1