2011-02-28 Michael Snyder <msnyder@vmware.com>
* coffread.c (coff_getfilename): Add check to avoid overflow.
This commit is contained in:
parent
2828854127
commit
9e91a35206
|
@ -1,5 +1,7 @@
|
|||
2011-02-28 Michael Snyder <msnyder@vmware.com>
|
||||
|
||||
* coffread.c (coff_getfilename): Add check to avoid overflow.
|
||||
|
||||
* objc-lang.c (selectors_info): Add a small safety margin to
|
||||
avoid overflow.
|
||||
(classes_info): Error out on too long REGEXP.
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue