PR driver/72765
* gcc.c (do_spec_1): Call save_string with the right size.
(save_string): Do an assert about string we copy.
From-SVN: r239475
+2016-08-15 Martin Liska <mliska@suse.cz>
+
+ PR driver/72765
+ * gcc.c (do_spec_1): Call save_string with the right size.
+ (save_string): Do an assert about string we copy.
+
2016-08-15 Richard Biener <rguenther@suse.de>
* ree.c (rest_of_handle_ree): Remove redundant timevar push/pop.
if (files_differ)
#endif
{
- temp_filename = save_string (temp_filename,
- temp_filename_length + 1);
+ temp_filename
+ = save_string (temp_filename,
+ temp_filename_length - 1);
obstack_grow (&obstack, temp_filename,
temp_filename_length);
arg_going = 1;
{
char *result = XNEWVEC (char, len + 1);
+ gcc_checking_assert (strlen (s) >= (unsigned int) len);
memcpy (result, s, len);
result[len] = 0;
return result;