[OE-core] [PATCH 0/1] Fix libxml2 unsafe memory access

kai.kang at windriver.com kai.kang at windriver.com
Wed Oct 28 05:22:52 UTC 2015


From: Kai Kang <kai.kang at windriver.com>

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

-- 
2.6.1



More information about the Openembedded-core mailing list