diff options
author | Michael Snyder <msnyder@vmware.com> | 2011-03-01 01:58:33 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2011-03-01 01:58:33 +0000 |
commit | 9e91a352064f48e0b806096988e03f6f4ebd35a0 (patch) | |
tree | 5b1a86badf081ad18ad81b0ba5325037e3782afb /gdb/coffread.c | |
parent | 28288541273e5c304eb056f4f408546dd0bdc75b (diff) | |
download | gdb-9e91a352064f48e0b806096988e03f6f4ebd35a0.zip gdb-9e91a352064f48e0b806096988e03f6f4ebd35a0.tar.gz gdb-9e91a352064f48e0b806096988e03f6f4ebd35a0.tar.bz2 |
2011-02-28 Michael Snyder <msnyder@vmware.com>
* coffread.c (coff_getfilename): Add check to avoid overflow.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r-- | gdb/coffread.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c index 1566611..9df775d 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1316,7 +1316,11 @@ coff_getfilename (union internal_auxent *aux_entry) char *result; if (aux_entry->x_file.x_n.x_zeroes == 0) - strcpy (buffer, stringtab + aux_entry->x_file.x_n.x_offset); + { + if (strlen (stringtab + aux_entry->x_file.x_n.x_offset) >= BUFSIZ) + internal_error (__FILE__, __LINE__, _("coff file name too long")); + strcpy (buffer, stringtab + aux_entry->x_file.x_n.x_offset); + } else { strncpy (buffer, aux_entry->x_file.x_fname, FILNMLEN); |