shlomif / perl-XML-LibXML

The XML-LibXML CPAN Distribution for Processing XML using the libxml2 library
https://metacpan.org/release/XML-LibXML
Other
17 stars 35 forks source link

Fix bug Node::replaceChild #8

Closed Mipu94 closed 6 years ago

Mipu94 commented 7 years ago

Fix bug us after free in XML::LibXML::Node::replaceChild. Here is my test file. Ref: https://rt.cpan.org/Public/Bug/Display.html?id=122246

Mipu94 commented 7 years ago

Hi Shlomi Fish, I added a regression test. Can you review it?

shlomif commented 7 years ago

On Thu, 13 Jul 2017 04:54:21 +0000 (UTC) sungta notifications@github.com wrote:

Hi Shlomi Fish, I added a regression test. Can you review it?

Yes, let me see.

ppisar commented 7 years ago

This returning NULL means an error. replaceChild() will return undef, replaceNode() will croak. While someone can consider replacing with the same node an error, I think idemponent shortcut as implemented in CPAN RT#122246 is better.

Mipu94 commented 7 years ago

haha my very first contribution so bad :D, that patch better than mine. would you like me to commit again?

shlomif commented 6 years ago

@Mipu94: yes, please make another commit with a test. Sorry for the late reply.

shlomif commented 6 years ago

@Mipu94 : ping!

Mipu94 commented 6 years ago

Hi Shlomif, I'm busy in this time. I will try commit ASAP. sorry for late reply.

shlomif commented 6 years ago

On Sun, 15 Oct 2017 05:51:07 +0000 (UTC) sungta notifications@github.com wrote:

Hi Shlomif, I'm busy in this time. I will try commit ASAP. sorry for late reply.

Thanks for letting me know.

--

Shlomi Fish http://www.shlomifish.org/ Interview with Ben Collins-Sussman - http://shlom.in/sussman

Windows Update doesn’t. — http://www.shlomifish.org/humour/bits/facts/Windows-Update/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

Mipu94 commented 6 years ago

I just made new commit.

shlomif commented 6 years ago

@Mipu94 : thanks - I'm going to check it.

shlomif commented 6 years ago

Merged, thanks! There was some trailing space and bad formatting - I fixed them.