Skip to content

Fix libxml2 unsafe memory access

[email protected] openembedded-core 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1libxml2: fix unsafe memory accessmeta/recipes-core/libxml/libxml2/libxml2-fix-unsafe-memory-access.patch meta/recipes-core/libxml/libxml2_2.9.2.bb+99 -15 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] Fix libxml2 unsafe memory access

From: Kai Kang <[email protected]>

The patch is from:

https://bugzilla.gnome.org/show_bug.cgi?id=746048

Build image with packagegroup-core-buildessential, boot the image and compile following c code:

==================================================
#include "string.h"

#include <libxml/HTMLparser.h>
#include <libxml/HTMLtree.h>

int main(int argc, char** argv)
{
// Nokogiri::HTML::fragment("<!-- ")

  htmlDocPtr doc ;
  int options = HTML_PARSE_RECOVER | HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING | HTML_PARSE_NONET ;

  char* HTMLFRAG_GOOD = "<html><body><!-- x" ;
  char* HTMLFRAG_BAD  = "<html><body><!--" ;

  char* HTMLFRAG = HTMLFRAG_BAD ;

  xmlInitParser();

doc = htmlReadMemory(HTMLFRAG, strlen(HTMLFRAG),

                       NULL,
                       "UTF-8",
                       options);

xmlFreeDoc(doc);
}
==================================================

Run with valgrind, there is no warning.

The following changes since commit 8a0d8eee432924433c3e70198aaeab3161476c5f:

toaster manual: Updated the set up and use chapter (2015-10-27 07:28:22 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib kangkai/libxml2
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=kangkai/libxml2

Kai Kang (1):
libxml2: fix unsafe memory access

 .../libxml2/libxml2-fix-unsafe-memory-access.patch | 97 ++++++++++++++++++++++
 meta/recipes-core/libxml/libxml2_2.9.2.bb          |  3 +-
 2 files changed, 99 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/libxml/libxml2/libxml2-fix-unsafe-memory-access.patch
Signature · 1 line
2.6.1