libwww-perl / HTML-Parser

The HTML-Parser distribution is is a collection of modules that parse and extract information from HTML documents.
Other
6 stars 13 forks source link

[PATCH] Protect active parser from being freed. [rt.cpan.org #115034] #15

Closed oalders closed 4 years ago

oalders commented 4 years ago

Migrated from rt.cpan.org#115034 (status was 'open')

Requestors:

Attachments:

From $_ = 'spro^^%^6ut#@&$>#!^!#&!pan.org'; y/a-z.@//cd; print on 2016-06-03 13:33:47 :

From nicolas@atoomic.org on 2020-08-24 16:17:42 :

On Fri Jun 03 09:33:47 2016, SPROUT wrote:
> This is a follow-up to
> <http://www.nntp.perl.org/group/perl.libwww/;msgid=7A27BD12-BA67-40B7-
> 9052-334CCE2C14DA@cpan.org>, from 6 years ago, but this time with a
> patch!
> 
> If you try to free the parser from a callback, it crashes, because
> pstate gets freed while things in the parser are still referring to
> it.

opened PR with this change and unit test as this is still an issue and generating a SEGV
view: https://github.com/gisle/html-parser/pull/13
genio commented 4 years ago

Fixed in 3.73 (via https://github.com/libwww-perl/HTML-Parser/commit/4e453608d13a495ed2365d6c663bbbbcab254f1f) out in the wild. Thank you!