Commit Graph

480 Commits

Author SHA1 Message Date
Sebastian Pipping
515f5d07c6 xmlparse.c: Improve warning regarding lack of high quality entropy (#172) 2019-10-26 15:23:09 +02:00
Sebastian Pipping
fc32dd491c xmlparse.c: Limit declaration of rand_s to mingwrt <5.3.0 2019-10-13 13:06:05 +02:00
Vadim Zeitlin
52aead2583 Declare rand_s() for MinGW 32 ourselves
Runtime files for MinGW don't contain rand_s() declaration, even in
their latest version, so declare it ourselves to avoid the warning about
missing function declaration.
2019-10-06 22:12:25 +02:00
Sebastian Pipping
24a912c12c xmlparse.c|xmlrole.c: Fix compiler warning "unused parameter" with -DEXPAT_DTD=OFF 2019-09-29 19:34:39 +02:00
Sebastian Pipping
d05afa5829 xmlparse.c: Address compiler warninging with -DEXPAT_CONTEXT_BYTES=OFF
Warning was:
comparison of integers of different signs: 'int' and 'unsigned long'
2019-09-29 19:34:39 +02:00
Sebastian Pipping
25c96511a0 Bump version from 2.2.8 to 2.2.9 2019-09-25 21:22:30 +02:00
bungeman
c6de942020
Only define _CRT_RAND_S when not already defined.
There exist builds which go out of their way to define _CRT_RAND_S for everything by forcing it into the list of macros defined on the command line to the compiler. Unfortunately, something like "-D_CRT_RAND_S" implies _CRT_RAND_S is defined to be '1' and defining it to be empty produces a redefinition.

Since the intention here is to ensure that _CRT_RAND_S is always defined, only define it if it isn't already defined.
2019-09-18 10:39:05 -04:00
Sebastian Pipping
a5414b759d Bump version from 2.2.7 to 2.2.8 2019-09-13 22:03:21 +02:00
Sebastian Pipping
c20b758c33 xmlparse.c: Deny internal entities closing the doctype 2019-08-28 15:14:26 +02:00
David Loffredo
561773607c handle unused parameters with the usual (void)param; statement rather than gcc-specific attribute
Signed-off-by: David Loffredo <loffredo@steptools.com>
2019-08-16 09:52:09 -04:00
Sebastian Pipping
8a935ff9ab xmlparse.c: Mention rand_s with stdlib include 2019-08-07 19:50:50 +02:00
David Loffredo
5d34a708e7 replace loadlibrary.c and RtlGenRandom call with rand_s() on windows
Signed-off-by: David Loffredo <loffredo@steptools.com>
2019-08-07 19:43:38 +02:00
David Loffredo
c5a2867de1 Make win32 stdlib.h define rand_s(), add writeRandomBytes_rand_s().
Signed-off-by: David Loffredo <loffredo@steptools.com>
2019-08-07 19:42:16 +02:00
Sebastian Pipping
4007706509 xmlparse.c: Fix effect of XML_StopParser for end element handlers (#240) 2019-08-04 15:15:27 +02:00
clang-format
d248bbd940 Mass-apply clang-format 9 using ./apply-clang-format.sh 2019-08-03 21:31:44 +02:00
Sebastian Pipping
3053f53d34 xmlparse.c: Address Clang Static Analyzer false positive (#295) 2019-07-28 00:09:25 +02:00
Sebastian Pipping
0117f01906 xmlparse.c: Limit scope of new_connector to save sizeof(char*) on the stack 2019-07-01 20:15:11 +02:00
Sebastian Pipping
eef2b12935 xmlparse.c: Drop needless re-calculation of keep (#268)
Fixes variable shadowing as a side effect.
2019-06-29 22:41:54 +02:00
Sebastian Pipping
94ea91cf6a xmlparse.c: Resolve temp variable shadow (#268)
Also add const.
2019-06-29 22:40:44 +02:00
Sebastian Pipping
d3b78b42a2 Bump version from 2.2.6 to 2.2.7 2019-06-19 18:41:14 +02:00
Sebastian Pipping
11f8838bf9 xmlparse.c: Fix extraction of namespace prefix from XML name (#186) 2019-06-12 15:42:54 +02:00
Mariusz Zaborski
7f3291057b Un-break build libexpat.
The writeRandomBytes_arc4random is not used if the arc4random_buf
is available. This caused compiler to throw warnings.
Finally this breaks a build when warnings are treated as errors.
2018-11-04 19:34:08 +01:00
Sebastian Pipping
c39d391550 Mark disabled code to make it easy to see again 2018-10-21 14:36:00 +02:00
Marco Maggi
5841ab111b change code exclusion style to make sure that the excluded code still compiles 2018-10-21 14:31:39 +02:00
Benjamin Peterson
fba16e0bfe Assume memmove(3) exists.
memmove is specified since POSIX.1-2001 and C89, and bcopy is deprecated.
2018-09-20 21:24:17 +02:00
Sebastian Pipping
39e487da35 Prepare release version 2.2.6 (#209) 2018-08-12 21:40:00 +02:00
Sebastian Pipping
50f4e1695f Re-add int casts dropped at 3960f6061a (#170)
This is meant to address warning C4244.

> C4244: '=' : conversion from '__int64' to 'int', possible loss of data
> C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data
2018-08-06 23:05:23 +02:00
Rhodri James
3960f6061a (#170) Prevent XML_GetBuffer doing arithmetic with NULL pointers 2018-08-06 19:56:50 +02:00
Rhodri James
428d69cd42 Remove senseless pointer arithmetic (issue #170) 2018-08-06 19:56:50 +02:00
Rhodri James
0959d8e409 Revise (according to @hartwork's plan) nearer to original code (#204)
This reverts commit 3f5b1cfa75.
2018-08-03 20:25:40 +02:00
Rhodri James
3f5b1cfa75 Fix for #204, XML_ResumeParser regression
When we suspend at the end of input, we failed to update the
parser's m_processor field to point to the epilogProcessor.  When
the regular contentProcessor runs with no input, it returns an
error (which is what you usually want).  If we had not suspended,
in those circumstances we would have run the epilogProcessor
instead, so we just make sure this is the processor we will invoke
when we resume parsing.
2018-08-03 20:19:05 +02:00
Anton Maklakov
7981e23331 Fix -Wimplicit-fallthrough related warnings 2018-07-06 10:12:05 +07:00
Sebastian Pipping
fc9fe8f17c Address warning about sip_tobin by Visual Studio
Message was:
Warning: C4551 function call missing argument
2017-12-03 17:33:35 +01:00
Sebastian Pipping
5f9bc4836f Prepare release version 2.2.5 (#133) 2017-10-31 17:20:31 +01:00
Sebastian Pipping
4cf92e08cf xmlparse.c: Add version information to XML_ErrorString messages
.. based on comments from enum XML_Error in expat.h.
2017-10-25 14:09:23 +02:00
Hans Wennborg
5ae72360c6 XML_ErrorString: handle XML_ERROR_INVALID_ARGUMENT
Previously, this enum didn't have any error string.
2017-10-25 13:42:44 +02:00
Hans Wennborg
0ab7640bd9 Rewrite XML_ErrorString to use a switch
This makes it a little easier to correlate each enumerator with its
error message, and the compiler should generate a lookup table anyway.

It also avoids running into Clang's -Wsign-compare warning when building
on Windows (where enum's are signed ints):

  error: comparison of integers of different signs: 'enum XML_Error'
  and 'unsigned int' [-Werror,-Wsign-compare]
  if (code > 0 && code < sizeof(message)/sizeof(message[0]))
                  ~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We ran into this when building Chromium on Windows using a recent version of
Clang.
2017-10-25 13:42:44 +02:00
Sebastian Pipping
5c224d67ec xmlparse.c: Make failproof entropy providers stand out more 2017-10-24 22:50:01 +02:00
Sebastian Pipping
a80b209884 xmlparse.c: Address warning about unused functions (#161) 2017-10-24 22:46:30 +02:00
Sebastian Pipping
a6f25bc39f xmlparse.c: Stop malloc/realloc/free macros from hiding parser (issue #59) 2017-09-03 02:00:23 +02:00
Sebastian Pipping
598be69685 xmlparse.c: Resolve macro "buffer" (issue #59) 2017-09-03 01:51:56 +02:00
Sebastian Pipping
66f64e58f8 xmlparse.c: Resolve macro "encoding" (issue #59) 2017-09-03 01:48:17 +02:00
Sebastian Pipping
9cc3ded1b8 xmlparse.c: Resolve macro "defaultExpandInternalEntities" (issue #59) 2017-09-03 01:42:25 +02:00
Sebastian Pipping
fe9deeeb79 xmlparse.c: Resolve macro "unknownEncodingHandlerData" (issue #59) 2017-09-03 01:42:25 +02:00
Sebastian Pipping
89017e2b1f xmlparse.c: Resolve macro "internalEntityRefHandler" (issue #59) 2017-09-03 01:42:25 +02:00
Sebastian Pipping
71950e96be xmlparse.c: Resolve macro "externalEntityRefHandlerArg" (issue #59) 2017-09-03 01:42:25 +02:00
Sebastian Pipping
28fd39ca7d xmlparse.c: Resolve macro "externalEntityRefHandler" (issue #59) 2017-09-03 01:42:25 +02:00
Sebastian Pipping
a0d9d36652 xmlparse.c: Resolve macro "startNamespaceDeclHandler" (issue #59) 2017-09-03 01:42:25 +02:00
Sebastian Pipping
6472431ab7 xmlparse.c: Resolve macro "unparsedEntityDeclHandler" (issue #59) 2017-09-03 01:42:25 +02:00
Sebastian Pipping
588570c96f xmlparse.c: Resolve macro "startCdataSectionHandler" (issue #59) 2017-09-03 01:42:25 +02:00