diff options
author | Brian Carlstrom <bdc@google.com> | 2016-09-21 10:34:18 -0700 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2017-03-01 11:38:50 +0000 |
commit | 69996bb2857e52345c744638f296e8fb4dd97eeb (patch) | |
tree | f4cc4a019c9a6ddfbb5ef4873df40264cdb13d0b /lib | |
parent | 2c4085a68c6cc84362eccc3a7bcc588700955c17 (diff) | |
download | expat-69996bb2857e52345c744638f296e8fb4dd97eeb.tar.gz |
Fix cast from pointer to integer of different size
Fixes last compilation bug. It now compiles on Android.
(cherry picked from 8caa27c2601e69bc404ff28fc4c5c39860d8d5bf)
Test: cts-tradefed run cts -m CtsLibcoreTestCases -t libcore.xml.ExpatSaxParserTest
Bug: 30157673
Bug: 29149404
Change-Id: I9be82ac4dfb430c8d7398aa69b100820957f6279
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xmlparse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/xmlparse.c b/lib/xmlparse.c index eac228b4..2f4e7258 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c @@ -3,6 +3,7 @@ */ #include <stddef.h> +#include <stdint.h> #include <string.h> /* memset(), memcpy() */ #include <assert.h> #include <limits.h> /* UINT_MAX */ @@ -722,7 +723,7 @@ generate_hash_secret_salt(XML_Parser parser) /* Process ID is 0 bits entropy if attacker has local access * XML_Parser address is few bits of entropy if attacker has local access */ const unsigned long entropy = - gather_time_entropy() ^ getpid() ^ (unsigned long)parser; + gather_time_entropy() ^ getpid() ^ (uintptr_t)parser; /* Factors are 2^31-1 and 2^61-1 (Mersenne primes M31 and M61) */ if (sizeof(unsigned long) == 4) { |