diff options
author | 2019-09-25 21:06:19 +0000 | |
---|---|---|
committer | 2019-09-25 21:06:19 +0000 | |
commit | 28ce31191121e9d8ab02660bd8b761ed56c7239d (patch) | |
tree | 76022246e38915f7864026db81d68525d3ba8cfa /lib/libexpat/examples/elements.c | |
parent | When battery state switches to critical, apmd(8) generates an (diff) | |
download | wireguard-openbsd-28ce31191121e9d8ab02660bd8b761ed56c7239d.tar.xz wireguard-openbsd-28ce31191121e9d8ab02660bd8b761ed56c7239d.zip |
Update libexpat to 2.2.8. CVE-2019-15903 has been fixed earlier
in our tree. Relevant is only bug fix #240. Most of the upstream
diff is automated source format change.
OK deraadt@
Diffstat (limited to 'lib/libexpat/examples/elements.c')
-rw-r--r-- | lib/libexpat/examples/elements.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/lib/libexpat/examples/elements.c b/lib/libexpat/examples/elements.c index 9d2027e449c..eb0c729bff1 100644 --- a/lib/libexpat/examples/elements.c +++ b/lib/libexpat/examples/elements.c @@ -38,25 +38,20 @@ #include <expat.h> #ifdef XML_LARGE_SIZE -# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 -# define XML_FMT_INT_MOD "I64" -# else # define XML_FMT_INT_MOD "ll" -# endif #else -# define XML_FMT_INT_MOD "l" +# define XML_FMT_INT_MOD "l" #endif #ifdef XML_UNICODE_WCHAR_T -# include <wchar.h> -# define XML_FMT_STR "ls" +# include <wchar.h> +# define XML_FMT_STR "ls" #else -# define XML_FMT_STR "s" +# define XML_FMT_STR "s" #endif static void XMLCALL -startElement(void *userData, const XML_Char *name, const XML_Char **atts) -{ +startElement(void *userData, const XML_Char *name, const XML_Char **atts) { int i; int *depthPtr = (int *)userData; (void)atts; @@ -68,8 +63,7 @@ startElement(void *userData, const XML_Char *name, const XML_Char **atts) } static void XMLCALL -endElement(void *userData, const XML_Char *name) -{ +endElement(void *userData, const XML_Char *name) { int *depthPtr = (int *)userData; (void)name; @@ -77,8 +71,7 @@ endElement(void *userData, const XML_Char *name) } int -main(int argc, char *argv[]) -{ +main(int argc, char *argv[]) { char buf[BUFSIZ]; XML_Parser parser = XML_ParserCreate(NULL); int done; @@ -92,13 +85,13 @@ main(int argc, char *argv[]) size_t len = fread(buf, 1, sizeof(buf), stdin); done = len < sizeof(buf); if (XML_Parse(parser, buf, (int)len, done) == XML_STATUS_ERROR) { - fprintf(stderr, - "%" XML_FMT_STR " at line %" XML_FMT_INT_MOD "u\n", + fprintf(stderr, "%" XML_FMT_STR " at line %" XML_FMT_INT_MOD "u\n", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser)); + XML_ParserFree(parser); return 1; } - } while (!done); + } while (! done); XML_ParserFree(parser); return 0; } |