Charles-François Natali added the comment: > I'd expect just casting the pointer type before dereferencing: > > unsigned char *p; > ... > hash = (multiplier * hash) ^ *((Py_uhash_t *)p); > > (don't use size_t, use Py_uhash_t)
Is p guaranteed to be size_t aligned? If not, unaligned access can segfault (e.g. on Sparc IIRC). > Also it may make DoS attacks easier. Indeed. And the increase in collision you demonstrated in your previous message worries me (both security and performance wise). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16427> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com