Skip to content

Instantly share code, notes, and snippets.

@cporter
Created November 27, 2013 21:32

Revisions

  1. cporter created this gist Nov 27, 2013.
    20 changes: 20 additions & 0 deletions rsvg-xml-huge
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    diff --git a/rsvg-base.c b/rsvg-base.c
    index 6210716..fe9a6cb 100644
    --- a/rsvg-base.c
    +++ b/rsvg-base.c
    @@ -1111,6 +1111,7 @@ rsvg_handle_write_impl (RsvgHandle * handle, const guchar * buf, gsize count, GE
    if (handle->priv->ctxt == NULL) {
    handle->priv->ctxt = xmlCreatePushParserCtxt (&rsvgSAXHandlerStruct, handle, NULL, 0,
    rsvg_handle_get_base_uri (handle));
    + handle->priv->ctxt->options |= XML_PARSE_HUGE;

    /* if false, external entities work, but internal ones don't. if true, internal entities
    work, but external ones don't. favor internal entities, in order to not cause a
    @@ -1767,6 +1768,7 @@ rsvg_handle_read_stream_sync (RsvgHandle *handle,
    if (priv->ctxt == NULL) {
    priv->ctxt = xmlCreatePushParserCtxt (&rsvgSAXHandlerStruct, handle, NULL, 0,
    rsvg_handle_get_base_uri (handle));
    + handle->priv->ctxt->options |= XML_PARSE_HUGE;

    /* if false, external entities work, but internal ones don't. if true, internal entities
    work, but external ones don't. favor internal entities, in order to not cause a