bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #59881] Segmentation Fault through manipulated Makefile


From: Dmitry Goncharov
Subject: [bug #59881] Segmentation Fault through manipulated Makefile
Date: Sun, 17 Jan 2021 21:37:30 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #2, bug #59881 (project make):

Here is a test.

diff --git a/tests/scripts/functions/error b/tests/scripts/functions/error
index 998afe4..cb8fcc4 100644
--- a/tests/scripts/functions/error
+++ b/tests/scripts/functions/error
@@ -63,6 +63,28 @@ $answer = "Some stuff\n$makefile:17: *** error is
definitely.  Stop.\n";
 $answer = "$makefile:22: *** Error found!.  Stop.\n";
 &compare_output($answer,&get_logfile(1));
 
+
+# Test #6
+# A makefile which causes variable_buffer_output to realloc and renders
buffer
+# invalid and used to crash make.
+# sv 59881.
+my $makestring = ':
+
+0:
+00000000
+000
    000000000000
                000000000:
+0%0:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000%0000000000000
+0';
+
+open(MAKEFILE, "> $makefile") or die "Failed to open $makefile: $!\n";
+print MAKEFILE $makestring;
+close(MAKEFILE) or die "Failed to write $makefile: $!\n";
+
+&run_make_with_options($makefile, '', &get_logfile, 512);
+my $answer = "$makefile:4: *** missing separator.  Stop.\n";
+&compare_output($answer, &get_logfile(1));
+
+
 # This tells the test driver that the perl test script executed properly.
 1;


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59881>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]