Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2017-02-27 01:35:44 +0300
committerbubnikv <bubnikv@gmail.com>2017-02-27 01:35:44 +0300
commit9ea570ea4e9322ab73cf43634a60e2d6f0b22c17 (patch)
tree89cb23f77a745c1870a191e643251e566c71a41b /xs
parent616788a600af888c40d659fdc604b81a90451d41 (diff)
Fix of a warning in expat parser, which turns to an error
on some Perl/XS installations (strawberry Perl 64bit)
Diffstat (limited to 'xs')
-rw-r--r--xs/src/expat/xmlparse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xs/src/expat/xmlparse.c b/xs/src/expat/xmlparse.c
index 30a24a0f8..fbe5e0200 100644
--- a/xs/src/expat/xmlparse.c
+++ b/xs/src/expat/xmlparse.c
@@ -710,8 +710,11 @@ 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 */
+ // Prusa3D specific: Fix for a following warning, which turns to an error on some Perl/XS installations:
+ // error: cast from 'XML_Parser' to 'long unsigned int' loses precision [-fpermissive]
+ unsigned long *parser_addr = (unsigned long*)&parser;
const unsigned long entropy =
- gather_time_entropy() ^ getpid() ^ (unsigned long)parser;
+ gather_time_entropy() ^ getpid() ^ *parser_addr;
/* Factors are 2^31-1 and 2^61-1 (Mersenne primes M31 and M61) */
if (sizeof(unsigned long) == 4) {