forked from Imagelibrary/binutils-gdb
Fix illegal memory accesses in the assembler when attempting to parse corrup tinput files.
PR 23054 * cond.c (s_ifsef): Replace use of obstack_copy with obstack_alloc followed by memcpy. (s_if, s_ifb, s_ifc, s_ifeqs): Likewise. * obj-elf.c (elf_adjust_symtab): Check for local symbols before attempting to dereference the sy_next field of a symbol. * stabs.c (get_stab_string_offset): Fail if there is no string following the stab directive.
This commit is contained in:
@@ -202,6 +202,12 @@ s_stab_generic (int what,
|
||||
int length;
|
||||
|
||||
string = demand_copy_C_string (&length);
|
||||
if (string == NULL)
|
||||
{
|
||||
as_warn (_(".stab%c: missing string"), what);
|
||||
ignore_rest_of_line ();
|
||||
return;
|
||||
}
|
||||
/* FIXME: We should probably find some other temporary storage
|
||||
for string, rather than leaking memory if someone else
|
||||
happens to use the notes obstack. */
|
||||
|
||||
Reference in New Issue
Block a user