[mod-xhtml-neg-cvs] mod_xhtml_neg mod_xhtml_neg.c,1.30,1.31
Brought to you by:
run2000
From: <ru...@us...> - 2004-03-31 09:57:14
|
Update of /cvsroot/mod-xhtml-neg/mod_xhtml_neg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26294 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/mod_xhtml_neg.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** mod_xhtml_neg.c 30 Mar 2004 10:35:46 -0000 1.30 --- mod_xhtml_neg.c 31 Mar 2004 09:45:28 -0000 1.31 *************** *** 620,623 **** --- 620,627 ---- * 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 *************** *** 637,641 **** data = ap_pstrcat( p, rec->name, ";", rec->charset, NULL ); len = mod_xhtml_strlen( data ); ! hash = lookup( data, len, 0 ); rec->hashcode = ap_psprintf(p, "\"%08lx\"", (unsigned long) hash); --- 641,645 ---- data = ap_pstrcat( p, rec->name, ";", rec->charset, NULL ); len = mod_xhtml_strlen( data ); ! hash = lookup( data, len, 0 ) & 0xffffffff; rec->hashcode = ap_psprintf(p, "\"%08lx\"", (unsigned long) hash); |