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) {