Overview
| Comment: | Make sure of_hash_seed is never initialized to 0
of_hash_seed == 0 is special, as it means to OFMapTable to behave |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | 0.8 |
| Files: | files | file ages | folders |
| SHA3-256: |
1b09ca22f34e69b97b964a057ca736ce |
| User & Date: | js on 2015-08-26 08:53:53 |
| Other Links: | branch diff | manifest | tags |
Context
|
2015-08-26
| ||
| 09:07 | OFZIPArchive: Throw invalid format on failed seek (check-in: 022994c409 user: js tags: 0.8) | |
| 08:53 | Make sure of_hash_seed is never initialized to 0 (check-in: 1b09ca22f3 user: js tags: 0.8) | |
| 08:24 | OFProcess: Send SIGTERM on close (check-in: 397b4ee50b user: js tags: 0.8) | |
Changes
Modified src/OFObject.m from [8a0142f57a] to [920a5b1adb].
| ︙ | ︙ | |||
226 227 228 229 230 231 232 233 234 235 236 237 238 | objc_setForwardHandler((IMP)&of_forward, (IMP)&of_forward_stret); #endif #ifdef HAVE_OBJC_ENUMERATIONMUTATION objc_setEnumerationMutationHandler(enumerationMutationHandler); #endif #if defined(HAVE_ARC4RANDOM) of_hash_seed = arc4random(); #elif defined(HAVE_RANDOM) struct timeval t; gettimeofday(&t, NULL); srandom((unsigned)(t.tv_sec ^ t.tv_usec)); | > > | > > | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
objc_setForwardHandler((IMP)&of_forward, (IMP)&of_forward_stret);
#endif
#ifdef HAVE_OBJC_ENUMERATIONMUTATION
objc_setEnumerationMutationHandler(enumerationMutationHandler);
#endif
of_hash_seed = 0;
while (of_hash_seed == 0) {
#if defined(HAVE_ARC4RANDOM)
of_hash_seed = arc4random();
#elif defined(HAVE_RANDOM)
struct timeval t;
gettimeofday(&t, NULL);
srandom((unsigned)(t.tv_sec ^ t.tv_usec));
of_hash_seed = (uint32_t)((random() << 16) |
(random() & 0xFFFF));
#else
struct timeval t;
gettimeofday(&t, NULL);
srand((unsigned)(t.tv_sec ^ t.tv_usec));
of_hash_seed = (uint32_t)((rand() << 16) | (rand() & 0xFFFF));
#endif
}
}
+ (void)unload
{
}
+ (void)initialize
{
|
| ︙ | ︙ |