Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting inner_html to empty string crashes nokogiri #88

Closed
romanbsd opened this issue Jun 24, 2009 · 4 comments
Closed

Setting inner_html to empty string crashes nokogiri #88

romanbsd opened this issue Jun 24, 2009 · 4 comments

Comments

@romanbsd
Copy link

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
    <head>
        <title>Example page</title>
    </head>

    <body>
    <style type="text/css" media="screen, print">
    @import 'http://wwwimg.bbc.co.uk/home/release-31-0/style/homepage.min.css';
    </style>
    <p>Test</p>
    </body>
</html>

--cut--

p = Nokogiri::HTML(IO.read('test.html'))
p.at('//style').inner_html = '' # => Boom!
@tenderlove
Copy link
Member

This doesn't break for me. What version of nokogiri and libxml2 are you using?

@romanbsd
Copy link
Author

romanbsd commented Jul 1, 2009

It's libxml2-2.6.26-2.1.2.7 (CentOS 5.3) and nokogiri (1.3.2)

@flavorjones
Copy link
Member

i can't even get 2.6.26 to build on ubuntu intrepid. sigh.

@tenderlove
Copy link
Member

fixing a segfault when an empty string is sent to Node#inner_html=. closed by c14d3b2

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants