From ac2c26a1613ea050fd882f0a9d0079e6f5d56129 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Thu, 3 Aug 2017 21:11:37 +0200 Subject: [PATCH 1/4] coverage.sh: Cover -funsigned-char for #109 --- expat/coverage.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/expat/coverage.sh b/expat/coverage.sh index 0600847a4..8f2e4d6ed 100755 --- a/expat/coverage.sh +++ b/expat/coverage.sh @@ -21,7 +21,12 @@ _get_build_dir() { mingw_part=__windows fi - echo "build__${version}__unicode_${unicode_enabled}__xml_context_${xml_context}${libbsd_part}${mingw_part}" + local char_part= + if ${with_unsigned_char}; then + char_part=__unsigned_char + fi + + echo "build__${version}__unicode_${unicode_enabled}__xml_context_${xml_context}${libbsd_part}${mingw_part}${char_part}" } @@ -95,6 +100,8 @@ _run() { local BASE_FLAGS='-pipe -Wall -Wextra -pedantic -Wno-overlength-strings' BASE_FLAGS+=' --coverage --no-inline' + ${with_unsigned_char} && BASE_FLAGS="${BASE_FLAGS} -funsigned-char" + local CFLAGS="-std=c99 ${BASE_FLAGS}" local CXXFLAGS="-std=c++98 ${BASE_FLAGS}" @@ -193,6 +200,7 @@ _main() { } # All combinations: + with_unsigned_char=false with_libbsd=false for with_mingw in true false ; do for unicode_enabled in false ; do @@ -204,6 +212,7 @@ _main() { # Single cases: with_libbsd=true _build_case + with_unsigned_char=true _build_case echo echo 'Merging coverage files...' From 7045b040acf01d1daf67d8afb5a2ccbca167c040 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Thu, 3 Aug 2017 21:23:59 +0200 Subject: [PATCH 2/4] tests/minicheck.c: Improve error message display --- expat/tests/minicheck.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/expat/tests/minicheck.c b/expat/tests/minicheck.c index a6cae231b..e6266ca4e 100644 --- a/expat/tests/minicheck.c +++ b/expat/tests/minicheck.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "internal.h" /* for UNUSED_P only */ #include "minicheck.h" @@ -186,8 +187,10 @@ _fail_unless(int UNUSED_P(condition), const char *UNUSED_P(file), int UNUSED_P(l we have a failure, so there's no reason to be quiet about what it is. */ - if (msg != NULL) - printf("%s", msg); + if (msg != NULL) { + const int has_newline = (msg[strlen(msg) - 1] == '\n'); + fprintf(stderr, "ERROR: %s%s", msg, has_newline ? "" : "\n"); + } longjmp(env, 1); } From d1f7f7bbd002692209d755b5b623f553b5fb55ed Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 3 Aug 2017 09:42:41 +0100 Subject: [PATCH 3/4] Fix tests for both x86 and non-x86. (#109) --- expat/tests/runtests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index aa95fd377..237de6e2f 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -5671,7 +5671,7 @@ static int XMLCALL prefix_converter(void *UNUSED_P(data), const char *s) { /* If the first byte is 0xff, raise an error */ - if (s[0] == -1) + if (s[0] == (char)-1) return -1; /* Just add the low bits of the first byte to the second */ return (s[1] + (s[0] & 0x7f)) & 0x01ff; From 791d1b3f0a82f8fd4dc4a925267ffdde7a7b1c6b Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Thu, 3 Aug 2017 21:32:28 +0200 Subject: [PATCH 4/4] Changes: Document changes related to #109 --- expat/Changes | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/expat/Changes b/expat/Changes index 147f48288..ab27ea0c2 100644 --- a/expat/Changes +++ b/expat/Changes @@ -2,6 +2,16 @@ NOTE: We are looking for help with a few things: https://github.com/libexpat/libexpat/labels/help%20wanted If you can help, please get in touch. Thanks! +Release 2.?.? ????????????????? + Other changes: + #109 Fix "make check" for non-x86 architectures that default + to unsigned type char (-128..127 rather than 0..255) + #109 coverage.sh: Cover -funsigned-char + Improve test suite error output + + Special thanks to: + Joe Orton + Release 2.2.3 Wed August 2 2017 Security fixes: #82 CVE-2017-11742 -- Windows: Fix DLL hijacking vulnerability