Git Product home page Git Product logo

Comments (2)

flavorjones avatar flavorjones commented on August 19, 2024

Here's the test case:

#! /usr/bin/env ruby
# mechanize #613

require "bundler/inline"

gemfile do
  source "https://rubygems.org"
  gem "nokogiri", path: "."
end

puts Nokogiri::VERSION_INFO

UTF8_TITLE = 'テスト'
UTF8 = <<-HTML
<title>#{UTF8_TITLE}</title>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
HTML

doc = Nokogiri::HTML4.parse(UTF8.force_encoding(Encoding::BINARY))
pp doc
pp doc.to_html
pp doc.errors

Success case is parsing the doc, failure case is raising an exception because htmlReadMemory returns NULL.

Git bisect says:

b167c7314497b6cb0d9a587a31874ae0d273ffaa is the first bad commit
commit b167c7314497b6cb0d9a587a31874ae0d273ffaa
Author: Nick Wellnhofer <[email protected]>
Date:   Tue Mar 14 14:42:36 2023 +0100

    parser: Fix short-lived regression causing infinite loops
    
    Fix 3eb6bf03. We really have to halt the parser, so the input buffer
    gets reset.

 include/private/parser.h |  2 ++
 parser.c                 | 37 ------------------------------------
 parserInternals.c        | 49 +++++++++++++++++++++++++++++++++++++++---------
 3 files changed, 42 insertions(+), 46 deletions(-)

from mechanize.

flavorjones avatar flavorjones commented on August 19, 2024

Bug report filed upstream here: https://gitlab.gnome.org/GNOME/libxml2/-/issues/543

from mechanize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.