develooper Front page | perl.perl5.porters | Postings from October 2012

[ #80415] hash order dependency bugs in CGI tests and code

Thread Previous
Yves via RT
October 26, 2012 01:40
[ #80415] hash order dependency bugs in CGI tests and code
Message ID:
<URL: >

I have been working on making it possible to add new hash algorithms to 
perl core and on making the hash seed random per process for security 

In my work on this I have encountered some hash order dependency bugs in 
the tests for CGI involving tags with more than one attribute. Making 
tag order optionally deterministic and then using the option in the 
tests solved the problem. The attached patch contains this fix. I left 
the new behavior undocumented as currently it exists only to make the 
tests happy.

There was a similar bug related to the positioning of the following 

#### Method: endform
# This method is DEPRECATED
*endform = \&end_form; # deprecated!

This was being executed before any subs were generated. Changing hash 
order would somehow cause subs to be loaded in an order such that this 
would not do the right thing and would fall through to an auto generated 
"end_form" tag. I moved the declaration to be part of the code for 
"end_form" and the bug went away.

It would be really nice if the attached patch or moral equivalent could 
get applied to CGI sometime soon as I would like to merge my hash 
changes to core soon and this is a roadblock.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About