Message186442
> 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). |
|
Date |
User |
Action |
Args |
2013-04-09 16:51:46 | neologix | set | recipients:
+ neologix, tim.peters, rhettinger, gregory.p.smith, jcea, mark.dickinson, pitrou, vstinner, christian.heimes, asvetlov, skrah, python-dev, serhiy.storchaka |
2013-04-09 16:51:46 | neologix | link | issue16427 messages |
2013-04-09 16:51:46 | neologix | create | |
|