]> granicus.if.org Git - fortune-mod/commitdiff
add a regression test for an overflow
authorShlomi Fish <shlomif@shlomifish.org>
Wed, 29 Apr 2020 20:35:59 +0000 (23:35 +0300)
committerShlomi Fish <shlomif@shlomifish.org>
Wed, 29 Apr 2020 20:35:59 +0000 (23:35 +0300)
fortune-mod/tests/t/valgrind.t

index 2790d88e45d9e97e416eaa5194d7354ae2a8e80f..97123fbc234221150ce8912b907b01de640d585a 100644 (file)
@@ -10,7 +10,7 @@ if ( $^O eq "MSWin32" )
 {
     plan skip_all => 'valgrind is not available on Windows';
 }
-plan tests => 5;
+plan tests => 6;
 
 my $obj = Test::RunValgrind->new( {} );
 
@@ -63,3 +63,13 @@ $obj->run(
         blurb  => 'strfile overflow test',
     }
 );
+
+# TEST
+$obj->run(
+    {
+        log_fn => './fortune--unstr-buffer-overflow.valgrind-log',
+        prog   => './unstr',
+        argv   => [ scalar( "AAAAAAAAAAAAAAAA/" x 1000 ) ],
+        blurb  => 'unstr overflow test',
+    }
+);