[mod-xhtml-neg-cvs] mod_xhtml_neg-2.0 mod_xhtml_neg.c,1.15,1.16
Brought to you by:
run2000
From: <ru...@us...> - 2004-03-31 09:57:58
|
Update of /cvsroot/mod-xhtml-neg/mod_xhtml_neg-2.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26507 Modified Files: mod_xhtml_neg.c Log Message: Added bitmask to hash code to make sure we get back a 32-bit value. Index: mod_xhtml_neg.c =================================================================== RCS file: /cvsroot/mod-xhtml-neg/mod_xhtml_neg-2.0/mod_xhtml_neg.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mod_xhtml_neg.c 30 Mar 2004 10:37:04 -0000 1.15 --- mod_xhtml_neg.c 31 Mar 2004 09:46:11 -0000 1.16 *************** *** 623,626 **** --- 623,630 ---- * The hash function is a hash in the public domain by By Bob Jenkins. See * lookupa.c or http://burtleburtle.net/bob/hash/doobs.html for details. + * Note that since we're only using this algorithm for Etag uniqueness rather + * than for a hashtable lookup, DoS attacks such as those described in + * http://www.cs.rice.edu/~scrosby/hash/ are not an issue here, especially + * since our hash keys come from data in either httpd.conf or .htaccess files. * * @param p a memory pool from which we can allocate temporary memory for this *************** *** 639,643 **** data = apr_pstrcat( p, rec->name, ";", rec->charset, NULL ); ! len = mod_xhtml_strlen( data ); hash = lookup( data, len, 0 ); --- 643,647 ---- data = apr_pstrcat( p, rec->name, ";", rec->charset, NULL ); ! len = mod_xhtml_strlen( data ) & 0xffffffff; hash = lookup( data, len, 0 ); |