From 05f4ab67ff65655e11139d273fd53a602347a6c5 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 15 Oct 2007 02:01:25 +0000 Subject: * read.c (do_s_func): Check asprintf return status. * stabs.c (stabs_generate_asm_func): Likewise. (stabs_generate_asm_endfunc): Likewise. --- gas/read.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gas/read.c') diff --git a/gas/read.c b/gas/read.c index baf85be..379b3f2 100644 --- a/gas/read.c +++ b/gas/read.c @@ -5671,14 +5671,20 @@ do_s_func (int end_p, const char *default_prefix) if (*input_line_pointer != ',') { if (default_prefix) - asprintf (&label, "%s%s", default_prefix, name); + { + if (asprintf (&label, "%s%s", default_prefix, name) == -1) + as_fatal ("%s", xstrerror (errno)); + } else { char leading_char = bfd_get_symbol_leading_char (stdoutput); /* Missing entry point, use function's name with the leading char prepended. */ if (leading_char) - asprintf (&label, "%c%s", leading_char, name); + { + if (asprintf (&label, "%c%s", leading_char, name) == -1) + as_fatal ("%s", xstrerror (errno)); + } else label = name; } -- cgit v1.1