"Fossies" - the Fresh Open Source Software Archive

Member "libspf2-1.2.10/perl/t/11_overflows.t" (28 Jan 2012, 521 Bytes) of package /linux/privat/libspf2-1.2.10.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 use strict;
    2 use warnings;
    3 use blib;
    4 use Test::More tests => 5;
    5 
    6 use_ok('Mail::SPF_XS');
    7 
    8 my $srv = new Mail::SPF_XS::Server({ debug => 0 });
    9 my $rec;
   10 
   11 $rec = $srv->compile("v=spf1 include:1234567");
   12 ok(1, 'parse_cidr did not run off start of data');
   13 
   14 eval { $rec = $srv->compile("v=spf1 include:" . ('A' x 5120) . " -all"); };
   15 ok(1, 'compile did not overrun buffer');
   16 ok(defined $@, 'compile at least threw an error');
   17 
   18 my $in = join("%{s}", (0..20));
   19 my $out = $srv->expand($in);
   20 ok(1, 'expand did not overrun buffer');