Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ t/entities.t Test encoding/decoding of entities
t/entities2.t Test _decode_entities()
t/filter-methods.t Test ignore_tags, ignore_elements methods.
t/filter.t Test HTML::Filter
t/free.t Test freeing of active parser
t/handler-eof.t Test invocation of $p->eof in handlers
t/handler.t Test $p->handler method
t/headparser-http.t Test HTML::HeadParser
Expand Down
1 change: 1 addition & 0 deletions Parser.xs
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ parse(self, chunk)
PREINIT:
PSTATE* p_state = get_pstate_hv(aTHX_ self);
PPCODE:
(void)sv_2mortal(SvREFCNT_inc(SvRV(self)));
if (p_state->parsing)
croak("Parse loop not allowed");
p_state->parsing = 1;
Expand Down
19 changes: 19 additions & 0 deletions t/free.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!perl

use strict;
use warnings;

use Test::More tests => 1;

use HTML::Parser;

my $p;
$p = HTML::Parser->new(
start_h => [sub {
undef $p;
}],
);

$p->parse(q(<foo>));

pass 'no SEGV';