* coffread.c (coff_getfilename): Add check to avoid overflow.
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.
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);