aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-02-19 13:19:57 +0000
committerNick Clifton <nickc@redhat.com>2016-02-19 13:19:57 +0000
commit3be64886b5cd7e877d8783a53b81e2c6f7d01307 (patch)
tree96e4d109fe131fd8d83dd323215eedb92d0e9e74 /gas/read.c
parent3d13c647015137e616267148a8d51194d13737bf (diff)
downloadgdb-3be64886b5cd7e877d8783a53b81e2c6f7d01307.zip
gdb-3be64886b5cd7e877d8783a53b81e2c6f7d01307.tar.gz
gdb-3be64886b5cd7e877d8783a53b81e2c6f7d01307.tar.bz2
Prevent seg-fault in gas reading a binary input file.
PR 19630 * read.c (read_a_source_file): Check for assemble_one returning with input_line_pointer set to NULL.
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gas/read.c b/gas/read.c
index 22da1df..5e0e3c8 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -1176,6 +1176,11 @@ read_a_source_file (char *name)
assemble_one (s); /* Assemble 1 instruction. */
+ /* PR 19630: The backend may have set ilp to NULL
+ if it encountered a catastrophic failure. */
+ if (input_line_pointer == NULL)
+ as_fatal (_("unable to continue with assembly."));
+
*input_line_pointer++ = nul_char;
/* We resume loop AFTER the end-of-line from