Discussion:
[Expat-bugs] [ expat-Bugs-3526620 ] undocumented XML_SetHashSalt(p, 0) semantics
SourceForge.net
2012-05-14 15:58:37 UTC
Permalink
Bugs item #3526620, was opened at 2012-05-14 08:58
Message generated for change (Tracker Item Submitted) made by jorton
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=3526620&group_id=10127

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Joe Orton (jorton)
Assigned to: Nobody/Anonymous (nobody)
Summary: undocumented XML_SetHashSalt(p, 0) semantics

Initial Comment:
Per e-mail discussion:

Tomas Hoger noticed that the semantics of XML_SetHashSalt are surprising
when 0 is passed. That value does not force a fixed hash salt, as might be
expected from reading the API description, but instead implies use of a
random hash salt, per startParsing():

if (hash_secret_salt == 0)
hash_secret_salt = generate_hash_secret_salt();

Which is the desired semantics? It would be simple to fix either the header
or the implementation. pyexpat is apparently using XML_SetHashSalt(parser,
0) hoping for a fixed hash salt.

Affects Version: expat 2.1.0

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=3526620&group_id=10127
SourceForge.net
2012-05-15 00:31:36 UTC
Permalink
Bugs item #3526620, was opened at 2012-05-14 08:58
Message generated for change (Comment added) made by kwaclaw
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=3526620&group_id=10127

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Joe Orton (jorton)
Assigned to: Nobody/Anonymous (nobody)
Summary: undocumented XML_SetHashSalt(p, 0) semantics

Initial Comment:
Per e-mail discussion:

Tomas Hoger noticed that the semantics of XML_SetHashSalt are surprising
when 0 is passed. That value does not force a fixed hash salt, as might be
expected from reading the API description, but instead implies use of a
random hash salt, per startParsing():

if (hash_secret_salt == 0)
hash_secret_salt = generate_hash_secret_salt();

Which is the desired semantics? It would be simple to fix either the header
or the implementation. pyexpat is apparently using XML_SetHashSalt(parser,
0) hoping for a fixed hash salt.

Affects Version: expat 2.1.0

----------------------------------------------------------------------
Comment By: Karl Waclawek (kwaclaw)
Date: 2012-05-14 17:31

Message:
Documentation corrected in reference.html rev. 1.76.
The sentinel value for the hash salt could be changed to a different value
in a later release, if this behavior causes a real issue. However, no code
should depend on the internal workings of the hash function in Expat.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=3526620&group_id=10127
Loading...