aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2002-11-18 20:45:48 +0000
committerAlexandre Oliva <aoliva@redhat.com>2002-11-18 20:45:48 +0000
commita816d1ed6a3d5f6d82f77b4e391f32332c1b1817 (patch)
tree25a841aa54ce5c296f76c5f1e34bc1bab994f920 /gas/config/tc-mips.c
parent6b70243f72bcad29cae24dec86c2bd531ff4dbbe (diff)
downloadgdb-a816d1ed6a3d5f6d82f77b4e391f32332c1b1817.zip
gdb-a816d1ed6a3d5f6d82f77b4e391f32332c1b1817.tar.gz
gdb-a816d1ed6a3d5f6d82f77b4e391f32332c1b1817.tar.bz2
* config/tc-mips.c (s_change_section): Make sure input buffer
is not accessed past the end. Don't hand obj_elf_change_section a pointer into the input buffer.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 611e775..02e9e9f 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -11657,7 +11657,8 @@ s_change_section (ignore)
section_name = input_line_pointer;
c = get_symbol_end ();
- next_c = *(input_line_pointer + 1);
+ if (c)
+ next_c = *(input_line_pointer + 1);
/* Do we have .section Name<,"flags">? */
if (c != ',' || (c == ',' && next_c == '"'))
@@ -11688,8 +11689,13 @@ s_change_section (ignore)
else
section_alignment = 0;
+ section_name = xstrdup (section_name);
+
obj_elf_change_section (section_name, section_type, section_flag,
section_entry_size, 0, 0, 0);
+
+ if (now_seg->name != section_name)
+ free (section_name);
#endif /* OBJ_ELF */
}