public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Romain Perier (mrpouet)" <mrpouet@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/libxml2/files: libxml2-2.7.4-parser-grow.patch
Date: Wed, 16 Sep 2009 08:05:17 +0000	[thread overview]
Message-ID: <E1MnpVt-0001hn-Hf@stork.gentoo.org> (raw)

mrpouet     09/09/16 08:05:17

  Added:                libxml2-2.7.4-parser-grow.patch
  Log:
  Fix inkscape extension loader problem per bug #285125, patch import from upstream bug #595128, thanks to Andreas Proteus <proteuss@sdf.lonestar.org> for tests
  (Portage version: 2.2_rc40/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  dev-libs/libxml2/files/libxml2-2.7.4-parser-grow.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/libxml2/files/libxml2-2.7.4-parser-grow.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/libxml2/files/libxml2-2.7.4-parser-grow.patch?rev=1.1&content-type=text/plain

Index: libxml2-2.7.4-parser-grow.patch
===================================================================
From 9d3d141c412baa5c713ad3df48f1a4d179e07b05 Mon Sep 17 00:00:00 2001
From: Daniel Veillard <veillard@redhat.com>
Date: Tue, 15 Sep 2009 16:41:30 +0000
Subject: Fix a parsing problem with little data at startup

* parser.c: inkscape extension loader (and possibly others) feed
  data to the parser very slowly, 0 at start, 4 bytes on first GROW
  and this broke after the fix for
  https://bugzilla.gnome.org/show_bug.cgi?id=566012
  http://git.gnome.org/cgit/libxml2/commit/?id=7e385bd4e28a0cc12b6b26ed178c620e3c3ab8d8
  leading to another bug
  https://bugzilla.redhat.com/show_bug.cgi?id=523002
  this detects the situation and GROW when needed for proper processing.
---
diff --git a/parser.c b/parser.c
index e415339..b41dcc3 100644
--- a/parser.c
+++ b/parser.c
@@ -10130,8 +10130,12 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
     /*
      * Check for the XMLDecl in the Prolog.
      * do not GROW here to avoid the detected encoder to decode more
-     * than just the first line
+     * than just the first line, unless the amount of data is really
+     * too small to hold "<?xml version="1.0" encoding="foo"
      */
+    if ((ctxt->input->end - ctxt->input->cur) < 35) {
+       GROW;
+    }
     if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
 
 	/*
--
cgit v0.8.2






             reply	other threads:[~2009-09-16  8:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16  8:05 Romain Perier (mrpouet) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-04-06 22:44 [gentoo-commits] gentoo-x86 commit in dev-libs/libxml2/files: libxml2-2.7.4-parser-grow.patch Gilles Dartiguelongue (eva)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1MnpVt-0001hn-Hf@stork.gentoo.org \
    --to=mrpouet@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox