From 8057c390ca1b3c5b78fe431c23221d2c87c7fb82 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Thu, 10 Dec 2009 21:15:25 +0000 Subject: [PATCH 1/3] Flattern all tags and dist tree for expat. --- contrib/expat/COPYING => COPYING | 0 contrib/expat/Changes => Changes | 0 contrib/expat/FREEBSD-upgrade => FREEBSD-upgrade | 0 contrib/expat/MANIFEST => MANIFEST | 0 contrib/expat/Makefile.in => Makefile.in | 0 contrib/expat/README => README | 0 contrib/expat/configure => configure | 0 contrib/expat/configure.in => configure.in | 0 {contrib/expat/doc => doc}/expat.png | Bin {contrib/expat/doc => doc}/reference.html | 0 {contrib/expat/doc => doc}/style.css | 0 {contrib/expat/doc => doc}/valid-xhtml10.png | Bin {contrib/expat/doc => doc}/xmlwf.1 | 0 {contrib/expat/doc => doc}/xmlwf.sgml | 0 {contrib/expat/examples => examples}/elements.c | 0 {contrib/expat/examples => examples}/outline.c | 0 .../expat/expat_config.h.in => expat_config.h.in | 0 {contrib/expat/lib => lib}/ascii.h | 0 {contrib/expat/lib => lib}/asciitab.h | 0 {contrib/expat/lib => lib}/expat.h | 0 {contrib/expat/lib => lib}/expat_external.h | 0 {contrib/expat/lib => lib}/iasciitab.h | 0 {contrib/expat/lib => lib}/internal.h | 0 {contrib/expat/lib => lib}/latin1tab.h | 0 {contrib/expat/lib => lib}/nametab.h | 0 {contrib/expat/lib => lib}/utf8tab.h | 0 {contrib/expat/lib => lib}/winconfig.h | 0 {contrib/expat/lib => lib}/xmlparse.c | 0 {contrib/expat/lib => lib}/xmlrole.c | 0 {contrib/expat/lib => lib}/xmlrole.h | 0 {contrib/expat/lib => lib}/xmltok.c | 0 {contrib/expat/lib => lib}/xmltok.h | 0 {contrib/expat/lib => lib}/xmltok_impl.c | 0 {contrib/expat/lib => lib}/xmltok_impl.h | 0 {contrib/expat/lib => lib}/xmltok_ns.c | 0 {contrib/expat/tests => tests}/README.txt | 0 {contrib/expat/tests => tests}/benchmark/README.txt | 0 .../expat/tests => tests}/benchmark/benchmark.c | 0 .../expat/tests => tests}/benchmark/benchmark.dsp | 0 .../expat/tests => tests}/benchmark/benchmark.dsw | 0 {contrib/expat/tests => tests}/chardata.c | 0 {contrib/expat/tests => tests}/chardata.h | 0 {contrib/expat/tests => tests}/minicheck.c | 0 {contrib/expat/tests => tests}/minicheck.h | 0 {contrib/expat/tests => tests}/runtests.c | 0 {contrib/expat/tests => tests}/runtestspp.cpp | 0 {contrib/expat/tests => tests}/xmltest.sh | 0 {contrib/expat/xmlwf => xmlwf}/codepage.c | 0 {contrib/expat/xmlwf => xmlwf}/codepage.h | 0 {contrib/expat/xmlwf => xmlwf}/ct.c | 0 {contrib/expat/xmlwf => xmlwf}/filemap.h | 0 {contrib/expat/xmlwf => xmlwf}/readfilemap.c | 0 {contrib/expat/xmlwf => xmlwf}/unixfilemap.c | 0 {contrib/expat/xmlwf => xmlwf}/win32filemap.c | 0 {contrib/expat/xmlwf => xmlwf}/xmlfile.c | 0 {contrib/expat/xmlwf => xmlwf}/xmlfile.h | 0 {contrib/expat/xmlwf => xmlwf}/xmlmime.c | 0 {contrib/expat/xmlwf => xmlwf}/xmlmime.h | 0 {contrib/expat/xmlwf => xmlwf}/xmltchar.h | 0 {contrib/expat/xmlwf => xmlwf}/xmlurl.h | 0 {contrib/expat/xmlwf => xmlwf}/xmlwf.c | 0 {contrib/expat/xmlwf => xmlwf}/xmlwin32url.cxx | 0 62 files changed, 0 insertions(+), 0 deletions(-) rename contrib/expat/COPYING => COPYING (100%) rename contrib/expat/Changes => Changes (100%) rename contrib/expat/FREEBSD-upgrade => FREEBSD-upgrade (100%) rename contrib/expat/MANIFEST => MANIFEST (100%) rename contrib/expat/Makefile.in => Makefile.in (100%) rename contrib/expat/README => README (100%) rename contrib/expat/configure => configure (100%) rename contrib/expat/configure.in => configure.in (100%) rename {contrib/expat/doc => doc}/expat.png (100%) rename {contrib/expat/doc => doc}/reference.html (100%) rename {contrib/expat/doc => doc}/style.css (100%) rename {contrib/expat/doc => doc}/valid-xhtml10.png (100%) rename {contrib/expat/doc => doc}/xmlwf.1 (100%) rename {contrib/expat/doc => doc}/xmlwf.sgml (100%) rename {contrib/expat/examples => examples}/elements.c (100%) rename {contrib/expat/examples => examples}/outline.c (100%) rename contrib/expat/expat_config.h.in => expat_config.h.in (100%) rename {contrib/expat/lib => lib}/ascii.h (100%) rename {contrib/expat/lib => lib}/asciitab.h (100%) rename {contrib/expat/lib => lib}/expat.h (100%) rename {contrib/expat/lib => lib}/expat_external.h (100%) rename {contrib/expat/lib => lib}/iasciitab.h (100%) rename {contrib/expat/lib => lib}/internal.h (100%) rename {contrib/expat/lib => lib}/latin1tab.h (100%) rename {contrib/expat/lib => lib}/nametab.h (100%) rename {contrib/expat/lib => lib}/utf8tab.h (100%) rename {contrib/expat/lib => lib}/winconfig.h (100%) rename {contrib/expat/lib => lib}/xmlparse.c (100%) rename {contrib/expat/lib => lib}/xmlrole.c (100%) rename {contrib/expat/lib => lib}/xmlrole.h (100%) rename {contrib/expat/lib => lib}/xmltok.c (100%) rename {contrib/expat/lib => lib}/xmltok.h (100%) rename {contrib/expat/lib => lib}/xmltok_impl.c (100%) rename {contrib/expat/lib => lib}/xmltok_impl.h (100%) rename {contrib/expat/lib => lib}/xmltok_ns.c (100%) rename {contrib/expat/tests => tests}/README.txt (100%) rename {contrib/expat/tests => tests}/benchmark/README.txt (100%) rename {contrib/expat/tests => tests}/benchmark/benchmark.c (100%) rename {contrib/expat/tests => tests}/benchmark/benchmark.dsp (100%) rename {contrib/expat/tests => tests}/benchmark/benchmark.dsw (100%) rename {contrib/expat/tests => tests}/chardata.c (100%) rename {contrib/expat/tests => tests}/chardata.h (100%) rename {contrib/expat/tests => tests}/minicheck.c (100%) rename {contrib/expat/tests => tests}/minicheck.h (100%) rename {contrib/expat/tests => tests}/runtests.c (100%) rename {contrib/expat/tests => tests}/runtestspp.cpp (100%) rename {contrib/expat/tests => tests}/xmltest.sh (100%) rename {contrib/expat/xmlwf => xmlwf}/codepage.c (100%) rename {contrib/expat/xmlwf => xmlwf}/codepage.h (100%) rename {contrib/expat/xmlwf => xmlwf}/ct.c (100%) rename {contrib/expat/xmlwf => xmlwf}/filemap.h (100%) rename {contrib/expat/xmlwf => xmlwf}/readfilemap.c (100%) rename {contrib/expat/xmlwf => xmlwf}/unixfilemap.c (100%) rename {contrib/expat/xmlwf => xmlwf}/win32filemap.c (100%) rename {contrib/expat/xmlwf => xmlwf}/xmlfile.c (100%) rename {contrib/expat/xmlwf => xmlwf}/xmlfile.h (100%) rename {contrib/expat/xmlwf => xmlwf}/xmlmime.c (100%) rename {contrib/expat/xmlwf => xmlwf}/xmlmime.h (100%) rename {contrib/expat/xmlwf => xmlwf}/xmltchar.h (100%) rename {contrib/expat/xmlwf => xmlwf}/xmlurl.h (100%) rename {contrib/expat/xmlwf => xmlwf}/xmlwf.c (100%) rename {contrib/expat/xmlwf => xmlwf}/xmlwin32url.cxx (100%) diff --git a/contrib/expat/COPYING b/COPYING similarity index 100% rename from contrib/expat/COPYING rename to COPYING diff --git a/contrib/expat/Changes b/Changes similarity index 100% rename from contrib/expat/Changes rename to Changes diff --git a/contrib/expat/FREEBSD-upgrade b/FREEBSD-upgrade similarity index 100% rename from contrib/expat/FREEBSD-upgrade rename to FREEBSD-upgrade diff --git a/contrib/expat/MANIFEST b/MANIFEST similarity index 100% rename from contrib/expat/MANIFEST rename to MANIFEST diff --git a/contrib/expat/Makefile.in b/Makefile.in similarity index 100% rename from contrib/expat/Makefile.in rename to Makefile.in diff --git a/contrib/expat/README b/README similarity index 100% rename from contrib/expat/README rename to README diff --git a/contrib/expat/configure b/configure similarity index 100% rename from contrib/expat/configure rename to configure diff --git a/contrib/expat/configure.in b/configure.in similarity index 100% rename from contrib/expat/configure.in rename to configure.in diff --git a/contrib/expat/doc/expat.png b/doc/expat.png similarity index 100% rename from contrib/expat/doc/expat.png rename to doc/expat.png diff --git a/contrib/expat/doc/reference.html b/doc/reference.html similarity index 100% rename from contrib/expat/doc/reference.html rename to doc/reference.html diff --git a/contrib/expat/doc/style.css b/doc/style.css similarity index 100% rename from contrib/expat/doc/style.css rename to doc/style.css diff --git a/contrib/expat/doc/valid-xhtml10.png b/doc/valid-xhtml10.png similarity index 100% rename from contrib/expat/doc/valid-xhtml10.png rename to doc/valid-xhtml10.png diff --git a/contrib/expat/doc/xmlwf.1 b/doc/xmlwf.1 similarity index 100% rename from contrib/expat/doc/xmlwf.1 rename to doc/xmlwf.1 diff --git a/contrib/expat/doc/xmlwf.sgml b/doc/xmlwf.sgml similarity index 100% rename from contrib/expat/doc/xmlwf.sgml rename to doc/xmlwf.sgml diff --git a/contrib/expat/examples/elements.c b/examples/elements.c similarity index 100% rename from contrib/expat/examples/elements.c rename to examples/elements.c diff --git a/contrib/expat/examples/outline.c b/examples/outline.c similarity index 100% rename from contrib/expat/examples/outline.c rename to examples/outline.c diff --git a/contrib/expat/expat_config.h.in b/expat_config.h.in similarity index 100% rename from contrib/expat/expat_config.h.in rename to expat_config.h.in diff --git a/contrib/expat/lib/ascii.h b/lib/ascii.h similarity index 100% rename from contrib/expat/lib/ascii.h rename to lib/ascii.h diff --git a/contrib/expat/lib/asciitab.h b/lib/asciitab.h similarity index 100% rename from contrib/expat/lib/asciitab.h rename to lib/asciitab.h diff --git a/contrib/expat/lib/expat.h b/lib/expat.h similarity index 100% rename from contrib/expat/lib/expat.h rename to lib/expat.h diff --git a/contrib/expat/lib/expat_external.h b/lib/expat_external.h similarity index 100% rename from contrib/expat/lib/expat_external.h rename to lib/expat_external.h diff --git a/contrib/expat/lib/iasciitab.h b/lib/iasciitab.h similarity index 100% rename from contrib/expat/lib/iasciitab.h rename to lib/iasciitab.h diff --git a/contrib/expat/lib/internal.h b/lib/internal.h similarity index 100% rename from contrib/expat/lib/internal.h rename to lib/internal.h diff --git a/contrib/expat/lib/latin1tab.h b/lib/latin1tab.h similarity index 100% rename from contrib/expat/lib/latin1tab.h rename to lib/latin1tab.h diff --git a/contrib/expat/lib/nametab.h b/lib/nametab.h similarity index 100% rename from contrib/expat/lib/nametab.h rename to lib/nametab.h diff --git a/contrib/expat/lib/utf8tab.h b/lib/utf8tab.h similarity index 100% rename from contrib/expat/lib/utf8tab.h rename to lib/utf8tab.h diff --git a/contrib/expat/lib/winconfig.h b/lib/winconfig.h similarity index 100% rename from contrib/expat/lib/winconfig.h rename to lib/winconfig.h diff --git a/contrib/expat/lib/xmlparse.c b/lib/xmlparse.c similarity index 100% rename from contrib/expat/lib/xmlparse.c rename to lib/xmlparse.c diff --git a/contrib/expat/lib/xmlrole.c b/lib/xmlrole.c similarity index 100% rename from contrib/expat/lib/xmlrole.c rename to lib/xmlrole.c diff --git a/contrib/expat/lib/xmlrole.h b/lib/xmlrole.h similarity index 100% rename from contrib/expat/lib/xmlrole.h rename to lib/xmlrole.h diff --git a/contrib/expat/lib/xmltok.c b/lib/xmltok.c similarity index 100% rename from contrib/expat/lib/xmltok.c rename to lib/xmltok.c diff --git a/contrib/expat/lib/xmltok.h b/lib/xmltok.h similarity index 100% rename from contrib/expat/lib/xmltok.h rename to lib/xmltok.h diff --git a/contrib/expat/lib/xmltok_impl.c b/lib/xmltok_impl.c similarity index 100% rename from contrib/expat/lib/xmltok_impl.c rename to lib/xmltok_impl.c diff --git a/contrib/expat/lib/xmltok_impl.h b/lib/xmltok_impl.h similarity index 100% rename from contrib/expat/lib/xmltok_impl.h rename to lib/xmltok_impl.h diff --git a/contrib/expat/lib/xmltok_ns.c b/lib/xmltok_ns.c similarity index 100% rename from contrib/expat/lib/xmltok_ns.c rename to lib/xmltok_ns.c diff --git a/contrib/expat/tests/README.txt b/tests/README.txt similarity index 100% rename from contrib/expat/tests/README.txt rename to tests/README.txt diff --git a/contrib/expat/tests/benchmark/README.txt b/tests/benchmark/README.txt similarity index 100% rename from contrib/expat/tests/benchmark/README.txt rename to tests/benchmark/README.txt diff --git a/contrib/expat/tests/benchmark/benchmark.c b/tests/benchmark/benchmark.c similarity index 100% rename from contrib/expat/tests/benchmark/benchmark.c rename to tests/benchmark/benchmark.c diff --git a/contrib/expat/tests/benchmark/benchmark.dsp b/tests/benchmark/benchmark.dsp similarity index 100% rename from contrib/expat/tests/benchmark/benchmark.dsp rename to tests/benchmark/benchmark.dsp diff --git a/contrib/expat/tests/benchmark/benchmark.dsw b/tests/benchmark/benchmark.dsw similarity index 100% rename from contrib/expat/tests/benchmark/benchmark.dsw rename to tests/benchmark/benchmark.dsw diff --git a/contrib/expat/tests/chardata.c b/tests/chardata.c similarity index 100% rename from contrib/expat/tests/chardata.c rename to tests/chardata.c diff --git a/contrib/expat/tests/chardata.h b/tests/chardata.h similarity index 100% rename from contrib/expat/tests/chardata.h rename to tests/chardata.h diff --git a/contrib/expat/tests/minicheck.c b/tests/minicheck.c similarity index 100% rename from contrib/expat/tests/minicheck.c rename to tests/minicheck.c diff --git a/contrib/expat/tests/minicheck.h b/tests/minicheck.h similarity index 100% rename from contrib/expat/tests/minicheck.h rename to tests/minicheck.h diff --git a/contrib/expat/tests/runtests.c b/tests/runtests.c similarity index 100% rename from contrib/expat/tests/runtests.c rename to tests/runtests.c diff --git a/contrib/expat/tests/runtestspp.cpp b/tests/runtestspp.cpp similarity index 100% rename from contrib/expat/tests/runtestspp.cpp rename to tests/runtestspp.cpp diff --git a/contrib/expat/tests/xmltest.sh b/tests/xmltest.sh similarity index 100% rename from contrib/expat/tests/xmltest.sh rename to tests/xmltest.sh diff --git a/contrib/expat/xmlwf/codepage.c b/xmlwf/codepage.c similarity index 100% rename from contrib/expat/xmlwf/codepage.c rename to xmlwf/codepage.c diff --git a/contrib/expat/xmlwf/codepage.h b/xmlwf/codepage.h similarity index 100% rename from contrib/expat/xmlwf/codepage.h rename to xmlwf/codepage.h diff --git a/contrib/expat/xmlwf/ct.c b/xmlwf/ct.c similarity index 100% rename from contrib/expat/xmlwf/ct.c rename to xmlwf/ct.c diff --git a/contrib/expat/xmlwf/filemap.h b/xmlwf/filemap.h similarity index 100% rename from contrib/expat/xmlwf/filemap.h rename to xmlwf/filemap.h diff --git a/contrib/expat/xmlwf/readfilemap.c b/xmlwf/readfilemap.c similarity index 100% rename from contrib/expat/xmlwf/readfilemap.c rename to xmlwf/readfilemap.c diff --git a/contrib/expat/xmlwf/unixfilemap.c b/xmlwf/unixfilemap.c similarity index 100% rename from contrib/expat/xmlwf/unixfilemap.c rename to xmlwf/unixfilemap.c diff --git a/contrib/expat/xmlwf/win32filemap.c b/xmlwf/win32filemap.c similarity index 100% rename from contrib/expat/xmlwf/win32filemap.c rename to xmlwf/win32filemap.c diff --git a/contrib/expat/xmlwf/xmlfile.c b/xmlwf/xmlfile.c similarity index 100% rename from contrib/expat/xmlwf/xmlfile.c rename to xmlwf/xmlfile.c diff --git a/contrib/expat/xmlwf/xmlfile.h b/xmlwf/xmlfile.h similarity index 100% rename from contrib/expat/xmlwf/xmlfile.h rename to xmlwf/xmlfile.h diff --git a/contrib/expat/xmlwf/xmlmime.c b/xmlwf/xmlmime.c similarity index 100% rename from contrib/expat/xmlwf/xmlmime.c rename to xmlwf/xmlmime.c diff --git a/contrib/expat/xmlwf/xmlmime.h b/xmlwf/xmlmime.h similarity index 100% rename from contrib/expat/xmlwf/xmlmime.h rename to xmlwf/xmlmime.h diff --git a/contrib/expat/xmlwf/xmltchar.h b/xmlwf/xmltchar.h similarity index 100% rename from contrib/expat/xmlwf/xmltchar.h rename to xmlwf/xmltchar.h diff --git a/contrib/expat/xmlwf/xmlurl.h b/xmlwf/xmlurl.h similarity index 100% rename from contrib/expat/xmlwf/xmlurl.h rename to xmlwf/xmlurl.h diff --git a/contrib/expat/xmlwf/xmlwf.c b/xmlwf/xmlwf.c similarity index 100% rename from contrib/expat/xmlwf/xmlwf.c rename to xmlwf/xmlwf.c diff --git a/contrib/expat/xmlwf/xmlwin32url.cxx b/xmlwf/xmlwin32url.cxx similarity index 100% rename from contrib/expat/xmlwf/xmlwin32url.cxx rename to xmlwf/xmlwin32url.cxx From e03f0571759059147077c3c20690a21239b3dfad Mon Sep 17 00:00:00 2001 From: Xin LI Date: Thu, 10 Dec 2009 21:23:46 +0000 Subject: [PATCH 2/3] Correct a DoS issue when processing XML document with malformed UTF-8 sequences. Obtained from: expat CVS (revisions 1.14 and 1.15) Security: CVE-2009-3560 --- lib/xmltok_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xmltok_impl.c b/lib/xmltok_impl.c index 12688192522..16dfb85f031 100644 --- a/lib/xmltok_impl.c +++ b/lib/xmltok_impl.c @@ -1744,7 +1744,7 @@ PREFIX(updatePosition)(const ENCODING *enc, const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ From 9fcd883dcb0db8be87165724e54d48a6c547c49f Mon Sep 17 00:00:00 2001 From: Xin LI Date: Fri, 11 Dec 2009 02:06:06 +0000 Subject: [PATCH 3/3] Apply a vendor fix (rev 1.165): Don't update next pointer since it could confuse tokenizer. Obtained from: expat CVS Security: CVE-2009-3720 --- lib/xmlparse.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/xmlparse.c b/lib/xmlparse.c index 94e31de9da3..e111460d0a3 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c @@ -3725,7 +3725,6 @@ doProlog(XML_Parser parser, return XML_ERROR_NO_ELEMENTS; default: tok = -tok; - next = end; break; } }